Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsCancelled ¶ added in v0.1.9
IsCancelled returns true if the context is cancelled, false otherwise, without blocking
func NewCancellableContext ¶ added in v0.1.10
NewCancellableContext creates a cancellable context that handles interrupt events timeout is the time after which the process will exit if not terminated after the context is cancelled
Types ¶
type RunnerRepository ¶ added in v0.1.11
type RunnerRepository struct {
// contains filtered or unexported fields
}
func NewRunnerRepository ¶ added in v0.1.11
func NewRunnerRepository() *RunnerRepository
func (*RunnerRepository) Start ¶ added in v0.1.11
func (repo *RunnerRepository) Start(ctx context.Context, runnable Runnable, params ...interface{}) *Task
func (*RunnerRepository) WaitUntilAllDone ¶ added in v0.1.11
func (repo *RunnerRepository) WaitUntilAllDone()
type SignalHandler ¶
type SignalHandler struct {
// contains filtered or unexported fields
}
SignalHandler allows to cancel a cancellable context on os interrupt signal reception
func (*SignalHandler) Run ¶
func (sh *SignalHandler) Run(ctx context.Context, params ...interface{}) error
Run takes a context and a context.CancelFunc as second parameter. if the third parameter is a time.Duration, the program forces exit after that timeout Wned the process receives an interrupt signal, the cancel function is called. Run is non blocking, it creates a goroutine to catch interrupt signal