Documentation ¶
Index ¶
- func FromPipeline(pipe *pipeline.Pipeline, log logger.Logger, cfg config.Configurer, ...) (*consumer, error)
- func NewBeanstalkConsumer(configKey string, log logger.Logger, cfg config.Configurer, e events.Handler, ...) (*consumer, error)
- type Config
- 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)
- type GlobalCfg
- type Item
- type Options
- type Plugin
- func (p *Plugin) Available()
- func (p *Plugin) FromPipeline(pipe *pipeline.Pipeline, eh events.Handler, pq priorityqueue.Queue) (jobs.Consumer, error)
- func (p *Plugin) Init(log logger.Logger, cfg config.Configurer) error
- func (p *Plugin) JobsConstruct(configKey string, eh events.Handler, pq priorityqueue.Queue) (jobs.Consumer, error)
- func (p *Plugin) Name() string
- func (p *Plugin) Serve() chan error
- func (p *Plugin) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromPipeline ¶
func NewBeanstalkConsumer ¶
func NewBeanstalkConsumer(configKey string, log logger.Logger, cfg config.Configurer, e events.Handler, pq priorityqueue.Queue) (*consumer, error)
Types ¶
type Config ¶
type Config struct { PipePriority int64 `mapstructure:"priority"` TubePriority *uint32 `mapstructure:"tube_priority"` Tube string `mapstructure:"tube"` ReserveTimeout time.Duration `mapstructure:"reserve_timeout"` }
func (*Config) InitDefault ¶
func (c *Config) InitDefault()
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 GlobalCfg ¶
type GlobalCfg struct { Addr string `mapstructure:"addr"` Timeout time.Duration `mapstructure:"timeout"` }
func (*GlobalCfg) InitDefault ¶
func (c *GlobalCfg) InitDefault()
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"` // 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.
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func (*Plugin) FromPipeline ¶
func (*Plugin) JobsConstruct ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.