Documentation ¶
Index ¶
- Constants
- Variables
- func NewProducerNode(endpoint, tube string) *producerNode
- func WithAt(at time.Time) queue.CallOptions
- func WithDuration(duration time.Duration) queue.CallOptions
- func WithHandle(handle ConsumeHandle) queue.Consumer
- type Beanstalkd
- type Conf
- type ConsumeHandle
- type ConsumerCluster
- type ConsumerOption
- type DelayPusher
- type ProducerCluster
- func (p *ProducerCluster) At(ctx context.Context, body []byte, at time.Time) (string, error)
- func (p *ProducerCluster) Close() error
- func (p *ProducerCluster) Delay(ctx context.Context, body []byte, delay time.Duration) (string, error)
- func (p *ProducerCluster) Name() string
- func (p *ProducerCluster) Push(ctx context.Context, _, body []byte, opts ...queue.CallOptions) (interface{}, error)
- func (p *ProducerCluster) Revoke(ctx context.Context, ids string) error
Constants ¶
View Source
const ( PriHigh = 1 PriNormal = 2 PriLow = 3 )
Variables ¶
View Source
var ErrTimeBeforeNow = errors.New("can't schedule task to past time")
Functions ¶
func NewProducerNode ¶
func NewProducerNode(endpoint, tube string) *producerNode
func WithDuration ¶
func WithDuration(duration time.Duration) queue.CallOptions
func WithHandle ¶
func WithHandle(handle ConsumeHandle) queue.Consumer
Types ¶
type Beanstalkd ¶
type Conf ¶
type Conf struct { Beanstalkd Redis redis.RedisConf }
type ConsumeHandle ¶
type ConsumerCluster ¶
type ConsumerCluster struct {
// contains filtered or unexported fields
}
func NewConsumer ¶
func NewConsumer(c Conf, handle queue.Consumer, opts ...ConsumerOption) *ConsumerCluster
func (ConsumerCluster) Start ¶
func (c ConsumerCluster) Start()
func (ConsumerCluster) Stop ¶
func (c ConsumerCluster) Stop()
type ConsumerOption ¶
type ConsumerOption func(*queueOptions)
func WithMetrics ¶
func WithMetrics(metrics *stat.Metrics) ConsumerOption
type DelayPusher ¶
type ProducerCluster ¶
type ProducerCluster struct {
// contains filtered or unexported fields
}
func NewProducer ¶
func NewProducer(beanstalk Beanstalkd) *ProducerCluster
func (*ProducerCluster) Close ¶
func (p *ProducerCluster) Close() error
func (*ProducerCluster) Name ¶
func (p *ProducerCluster) Name() string
func (*ProducerCluster) Push ¶
func (p *ProducerCluster) Push( ctx context.Context, _, body []byte, opts ...queue.CallOptions) (interface{}, error)
Click to show internal directories.
Click to hide internal directories.