Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AllowOption ¶
type AllowOption struct { RetryCount *int64 RetryDelay *time.Duration RetryFactor *float64 RetryMin *time.Duration RetryMax *time.Duration Jitter *bool Timeout *time.Duration }
AllowOption is a function that sets some option on the Options
type Message ¶
type Message struct { Task TaskFunc `json:"-"` // Timeout is the duration the task can be processed by Handler. // zero if not specified // default is 60 time.Minute Timeout time.Duration `json:"timeout"` // Payload is the payload data of the task. Payload []byte `json:"body"` // RetryCount set count of retry // default is 0, no retry. RetryCount int64 `json:"retry_count"` // RetryDelay set delay between retry // default is 100ms RetryDelay time.Duration `json:"retry_delay"` // RetryFactor is the multiplying factor for each increment step. // // Defaults to 2. RetryFactor float64 `json:"retry_factor"` // Minimum value of the counter. // // Defaults to 100 milliseconds. RetryMin time.Duration `json:"retry_min"` // Maximum value of the counter. // // Defaults to 10 seconds. RetryMax time.Duration `json:"retry_max"` // Jitter eases contention by randomizing backoff steps Jitter bool `json:"jitter"` // Data to save Unsafe cast Data []byte }
Message describes a task and its metadata.
func NewMessage ¶
func NewMessage(m core.QueuedMessage, opts ...AllowOption) Message
NewMessage create new message
Click to show internal directories.
Click to hide internal directories.