Documentation
¶
Index ¶
- type ConnPool
- func (cp *ConnPool) Delete(_ context.Context, id uint64) error
- func (cp *ConnPool) Put(_ context.Context, body []byte, pri uint32, delay, ttr time.Duration) (uint64, error)
- func (cp *ConnPool) Reserve(reserveTimeout time.Duration) (uint64, []byte, error)
- func (cp *ConnPool) Stats(_ context.Context) (map[string]string, error)
- func (cp *ConnPool) Stop()
- type Consumer
- func (c *Consumer) Pause(_ context.Context, p string)
- func (c *Consumer) Push(ctx context.Context, jb *jobs.Job) error
- func (c *Consumer) Register(_ context.Context, p *pipeline.Pipeline) error
- func (c *Consumer) Resume(_ context.Context, p string)
- func (c *Consumer) Run(_ context.Context, p *pipeline.Pipeline) error
- func (c *Consumer) State(ctx context.Context) (*jobs.State, error)
- func (c *Consumer) Stop(context.Context) error
- type Item
- func (i *Item) Ack() error
- func (i *Item) Body() []byte
- func (i *Item) Context() ([]byte, error)
- func (i *Item) ID() string
- func (i *Item) Nack() error
- func (i *Item) Priority() int64
- func (i *Item) Requeue(headers map[string][]string, delay int64) error
- func (i *Item) Respond(_ []byte, _ string) error
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnPool ¶
func NewConnPool ¶
func (*ConnPool) Put ¶
func (cp *ConnPool) Put(_ context.Context, body []byte, pri uint32, delay, ttr time.Duration) (uint64, error)
Put the payload TODO use the context ??
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
func FromPipeline ¶
func FromPipeline(pipe *pipeline.Pipeline, log *zap.Logger, cfg cfgPlugin.Configurer, pq priorityqueue.Queue) (*Consumer, error)
func NewBeanstalkConsumer ¶
func NewBeanstalkConsumer(configKey string, log *zap.Logger, cfg cfgPlugin.Configurer, pq priorityqueue.Queue) (*Consumer, error)
func (*Consumer) State ¶
State https://github.com/beanstalkd/beanstalkd/blob/master/doc/protocol.txt#L514
type Item ¶
type Item struct { // Job contains pluginName of job broker (usually PHP class). Job string `json:"job"` // Ident is unique identifier of the job, should be provided from outside Ident string `json:"id"` // Payload is string data (usually JSON) passed to Job broker. Payload string `json:"payload"` // Headers with key-values pairs Headers map[string][]string `json:"headers"` // Options contains set of PipelineOptions specific to job execution. Can be empty. Options *Options `json:"options,omitempty"` }
type Options ¶
type Options struct { // Priority is job priority, default - 10 // pointer to distinguish 0 as a priority and nil as priority not set Priority int64 `json:"priority"` // Pipeline manually specified pipeline. Pipeline string `json:"pipeline,omitempty"` // Delay defines time duration to delay execution for. Defaults to none. Delay int64 `json:"delay,omitempty"` // AutoAck option AutoAck bool `json:"auto_ack"` // contains filtered or unexported fields }
Options carry information about how to handle given job.
func (*Options) DelayDuration ¶
DelayDuration returns delay duration in a form of time.Duration.
Click to show internal directories.
Click to hide internal directories.