Skip to content

Commit

Permalink
bigmachine: rename Bootstrap to Init; use in place of ad-hoc inits
Browse files Browse the repository at this point in the history
Reviewers: ysaito, jcharumilind, pgopal

Reviewed By: ysaito, jcharumilind

Differential Revision: https://phabricator.grailbio.com/D38181

fbshipit-source-id: 9e10199
  • Loading branch information
mariusae committed Oct 23, 2019
1 parent d91dc24 commit 43b2b4b
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions system.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ var (
// system implementation. RegisterSystem registers the implementation
// with gob, so that instances can be transmitted over the wire. It
// also registers the provided System instance as a default to use
// for the name to support bigmachine.Bootstrap.
// for the name to support bigmachine.Init.
func RegisterSystem(name string, system System) {
gob.Register(system)
systemsMu.Lock()
Expand All @@ -80,14 +80,11 @@ func RegisterSystem(name string, system System) {
systems[name] = system
}

// Bootstrap provides an alternative path to bootstrap a bigmachine
// node. If a binary follows a non-deterministic path to
// bigmachine.Start, or wishes to forego needless initialization, it
// may call Bootstrap. Bootstrap is a no-op if the binary is not
// running as a bigmachine worker; if it is, Bootstrap never returns.
//
// This is an experimental API.
func Bootstrap() {
// Init initializes bigmachine. It should be called after flag
// parsing and global setup in bigmachine-based processes. Init is a
// no-op if the binary is not running as a bigmachine worker; if it
// is, Init never returns.
func Init() {
name := os.Getenv("BIGMACHINE_SYSTEM")
if name == "" {
return
Expand Down

0 comments on commit 43b2b4b

Please sign in to comment.