Documentation ¶
Index ¶
- func InitSignals() context.Context
- func InitiateShutdown()
- func LogSignalAndStop()
- func ShutdownWait(allJobs ...*RunningJob)
- func Sleep(ctx context.Context, delay time.Duration)
- func StopIfCanceled()
- func WaitAll(finishCTX context.Context, allJobs ...*RunningJob)
- func WaitUntilSignal()
- type JobForTests
- type NamedFunction
- type RunningJob
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitSignals ¶
func InitiateShutdown ¶
func InitiateShutdown()
func LogSignalAndStop ¶
func LogSignalAndStop()
func ShutdownWait ¶
func ShutdownWait(allJobs ...*RunningJob)
Assumes WaitUntilSignal finished therefore all jobs already started their shutdown.
func StopIfCanceled ¶
func StopIfCanceled()
func WaitAll ¶
func WaitAll(finishCTX context.Context, allJobs ...*RunningJob)
func WaitUntilSignal ¶
func WaitUntilSignal()
Types ¶
type JobForTests ¶
type JobForTests struct {
// contains filtered or unexported fields
}
func StartForTests ¶
func StartForTests(job func(context.Context)) JobForTests
For the convenience of tests creates a context underneath.
func (JobForTests) Quit ¶
func (q JobForTests) Quit()
type NamedFunction ¶
type NamedFunction struct {
// contains filtered or unexported fields
}
func EmptyJob ¶
func EmptyJob() NamedFunction
func Later ¶
func Later(name string, job func()) NamedFunction
func (NamedFunction) Start ¶
func (nf NamedFunction) Start() *RunningJob
type RunningJob ¶
type RunningJob struct {
// contains filtered or unexported fields
}
func Start ¶
func Start(name string, job func()) RunningJob
func (*RunningJob) MustWait ¶
func (q *RunningJob) MustWait()
Click to show internal directories.
Click to hide internal directories.