package bootstrap

import "github.com/edgexfoundry/go-mod-bootstrap/bootstrap"

Index

Functions

func Run

func Run(
	ctx context.Context,
	cancel context.CancelFunc,
	commonFlags flags.Common,
	serviceKey string,
	configStem string,
	serviceConfig interfaces.Configuration,
	startupTimer startup.Timer,
	dic *di.Container,
	handlers []interfaces.BootstrapHandler)

Run bootstraps an application. It loads configuration and calls the provided list of handlers. Any long-running process should be spawned as a go routine in a handler. Handlers are expected to return immediately. Once all of the handlers are called this function will wait for any go routines spawned inside the handlers to exit before returning to the caller. It is intended that the caller stop executing on the return of this function.

Types

type Deferred

type Deferred func()

Deferred defines the signature of a function returned by RunAndReturnWaitGroup that should be executed via defer.

func RunAndReturnWaitGroup

func RunAndReturnWaitGroup(
	ctx context.Context,
	cancel context.CancelFunc,
	commonFlags flags.Common,
	serviceKey string,
	configStem string,
	serviceConfig interfaces.Configuration,
	configUpdated config.UpdatedStream,
	startupTimer startup.Timer,
	dic *di.Container,
	handlers []interfaces.BootstrapHandler) (*sync.WaitGroup, Deferred, bool)

RunAndReturnWaitGroup bootstraps an application. It loads configuration and calls the provided list of handlers. Any long-running process should be spawned as a go routine in a handler. Handlers are expected to return immediately. Once all of the handlers are called this function will return a sync.WaitGroup reference to the caller. It is intended that the caller take whatever additional action makes sense before calling Wait() on the returned reference to wait for the application to be signaled to stop (and the corresponding goroutines spawned in the various handlers to be stopped cleanly).

Source Files

bootstrap.go

Directories

PathSynopsis
bootstrap/config******************************************************************************
bootstrap/container
bootstrap/environment
bootstrap/flags
bootstrap/handlers
bootstrap/interfaces
bootstrap/interfaces/mocks
bootstrap/registration
bootstrap/secret
bootstrap/startup
Version
v0.0.72 (latest)
Published
Jan 19, 2021
Platform
linux/amd64
Imports
16 packages
Last checked
5 days ago

Tools for package owners.