Struct disque::Disque [] [src]

pub struct Disque { /* fields omitted */ }

Methods

impl Disque
[src]

Opens a new connection to a Disque server.

Examples

let disque = Disque::open("redis://127.0.0.1:7711/").unwrap();

The hello command returns information about the disque cluster.

Examples

let disque = Disque::open("redis://127.0.0.1:7711/").unwrap();
let (_, nodeid, _) = disque.hello().unwrap();
println!("Connected to node {}", nodeid);

Adds a job to a queue.

Examples

let disque = Disque::open("redis://127.0.0.1:7711/").unwrap();
let jobid = disque.addjob(b"my queue", b"my job",
  Duration::from_secs(10), None, None, None, None, None, false
  ).unwrap();
println!("My job id is {}", jobid);

Gets up to count jobs from certain queues.

Examples

let disque = Disque::open("redis://127.0.0.1:7711/").unwrap();
let queue = b"my getjob_count queue";
disque.addjob(queue, b"my job 1", Duration::from_secs(10),
  None, None, None, None, None, false
  ).unwrap();
disque.addjob(queue, b"my job 2", Duration::from_secs(10),
  None, None, None, None, None, false
  ).unwrap();

let jobs = disque.getjob_count(true, None, 10, &[queue]).unwrap();
assert_eq!(jobs.len(), 2);
assert_eq!(jobs[0].2, b"my job 1");
assert_eq!(jobs[1].2, b"my job 2");

Gets a single job from any of the specified queues.

Gets a single job from any of the specified queues with its nack and additional deliveries count.

Acknowledge jobs.

Acknowledge a job.

Fast acknowledge jobs.

Fast acknowledge a job.

Tell Disque that a job is still processed.

Tells Disque to put back the jobs in the queue ASAP. Should be used when the worker was not able to process a message and wants the message to be put back into the queue in order to be processed again.

Tells Disque to put back a job in the queue ASAP.

Information about the server

Size of the queue

Gets jobs from queue_name up to the absolute number of count. If count is negative, it will be from newest to oldest.

Add jobs to queues

Remove jobs from queue

Completely delete jobs from a single node.

Completely delete a job from a single node.

Returns full information about a job, like its current state and data.

Iterator to run all queues that fulfil a criteria. The iterator will batch into segments of approximate count size.

Iterator for all job ids that fulfil a criteria. The iterator will batch into segments of approximate count size.

Iterator for all jobs that fulfil a criteria. The iterator will batch into segments of approximate count size.