Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Options singleton
Functions ¶
This section is empty.
Types ¶
type ListenCloser ¶
type ListenCloser interface { // Listen starts a long-lived component. // It is the caller's responsibility to call Listen on the Runner. // It is the Runner's responsibility to call Listen on Task values // provided via the TaskFactory. Listen() // Closer should cause the Listen method to terminate. // The Runner waits until Listen has finished. io.Closer }
type Runner ¶
type Runner interface { ListenCloser // Reload sends a signal to the Runner to invoke the supplied // TaskFactory to build a new Task instance. If the new Task // initializes without error and indicates its readiness via // the supplied `chan<- bool` (see the TaskFactory) the runner // will call Close on the previously running Task (if any). // Both the old and new Task values will be running simultaneously // for a short time (by design). Reload() }
type Task ¶
type Task interface { // Initialize provides an opportunity for the task to load its // configuration, incorporating the supplied context.Context for // operations that support it. This step should only prepare to // perform the work but should not perform any significant work // which might block termination signals from being handled. Initialize(ctx context.Context) error ListenCloser }
Task describes a type supplied by the caller, via the TaskFactory. Generally a task is a long-lived component (like an HTTP server).
type TaskFactory ¶
TaskFactory is a callback for building whatever task will be managed by the Runner. The supplied task should call the ready func to indicate its readiness to begin working. Only the first call has any effect.
Click to show internal directories.
Click to hide internal directories.