Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Job ¶
type Job struct {
ID string // unique identifier for the job.
Ack func(err error) // acknowledge callback when message is processed.
Time time.Time // time at which this job was created.
Error error // error during processing if any.
Payload interface{} // payload of the message.
}
Job represents the job request to the worker.
func (*Job) EnsureValid ¶
EnsureValid sets defaults for unset fields where possible and validates the job definition.
type Option ¶
type Option func(ws *workerSession) error
Option can be provided to Run() to customise run behaviour of the worker.
func WithLogger ¶
WithLogger sets the logger to be used by worker. If nil, logging is disabled.
Click to show internal directories.
Click to hide internal directories.