Documentation ¶
Index ¶
- type Config
- type Job
- type Pool
- func (pool *Pool) Ack(job *Job) error
- func (pool *Pool) Add(data string, queue string) (*Job, error)
- func (pool *Pool) Close() error
- func (pool *Pool) Delay(delay time.Duration) *Pool
- func (pool *Pool) Get(queues ...string) (*Job, error)
- func (pool *Pool) Len(queue string) (int, error)
- func (pool *Pool) MaxLen(maxlen int) *Pool
- func (pool *Pool) Nack(job *Job) error
- func (pool *Pool) Ping() error
- func (pool *Pool) Replicate(replicate int) *Pool
- func (pool *Pool) RetryAfter(after time.Duration) *Pool
- func (pool *Pool) TTL(ttl time.Duration) *Pool
- func (pool *Pool) Timeout(timeout time.Duration) *Pool
- func (pool *Pool) Use(conf Config) *Pool
- func (pool *Pool) Wait(job *Job) error
- func (pool *Pool) With(conf Config) *Pool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Timeout time.Duration // Each operation fails after a specified timeout elapses. Blocks by default. Replicate int // Replicate job to at least N nodes before Add() returns. Delay time.Duration // Schedule the job on Add() - enqueue after a specified time. RetryAfter time.Duration // Re-queue job after a specified time elapses between Get() and Ack(). TTL time.Duration // Remove the job from the queue after a specified time. MaxLen int // Fail on Add() if there are more than N jobs in the queue. }
Config represents Disque configuration for certain operations.
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool represent Redis connection to a Disque Pool with a certain Disque configuration.
func (*Pool) Get ¶
Get returns first available job from a highest priority queue possible (left-to-right priority).
func (*Pool) Nack ¶
Nack re-queues a job back into its queue. Native NACKJOB discussed upstream at https://github.com/antirez/disque/issues/43.
func (*Pool) RetryAfter ¶
RetryAfter option applied to a single operation.
func (*Pool) Wait ¶
Wait waits for a job to finish (blocks until it's ACKed). Native WAITJOB discussed upstream at https://github.com/antirez/disque/issues/43.
Click to show internal directories.
Click to hide internal directories.