Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine interface { // RegisterJob registers a new Job with the async engine RegisterJob(name string, fn JobFn) error // SubmitTask submits an idempotent task to the async engine for reliable, // asynchronous completion SubmitTask(Task) error // Run causes the async engine to carry out all of its functions. It blocks // until a fatal error is encountered or the context passed to it has been // canceled. Run always returns a non-nil error. Run(context.Context) error }
Engine is an interface for a broker-specifc framework for submitting and asynchronously completing provisioning and deprovisioning tasks.
type JobFn ¶ added in v0.10.0
JobFn is the signature for functions that workers can call to asynchronously execute a job
type Task ¶ added in v0.10.0
type Task interface { GetID() string GetJobName() string GetArgs() map[string]string GetWorkerRejectionCount() int IncrementWorkerRejectionCount() int ToJSON() ([]byte, error) GetExecuteTime() *time.Time }
Task is an interface to be implemented by types that represent a single asynchronous task
func NewDelayedTask ¶ added in v0.10.0
NewDelayedTask returns a new task that will fire after a specified duration
func NewScheduledTask ¶ added in v0.10.0
NewScheduledTask returns a new task that will fire after a specified time
func NewTaskFromJSON ¶ added in v0.10.0
NewTaskFromJSON returns a new Task unmarshalled from the provided []byte
Click to show internal directories.
Click to hide internal directories.