Struct disque::JobQueryBuilder
source · pub struct JobQueryBuilder<'a> { /* private fields */ }
Expand description
Helper to get a list of jobs
Examples
let disque = Disque::open("redis://127.0.0.1:7711/").unwrap();
let jobs = JobQueryBuilder::new().queue(b"my queue").state("queued")
.iter_ids(&disque).unwrap().collect::<Vec<_>>();
assert!(jobs.len() >= 0);
Implementations§
source§impl<'a> JobQueryBuilder<'a>
impl<'a> JobQueryBuilder<'a>
pub fn new() -> JobQueryBuilder<'a>
sourcepub fn count(&mut self, count: u64) -> &mut Self
pub fn count(&mut self, count: u64) -> &mut Self
A hint about how much work to do per iteration.
sourcepub fn busyloop(&mut self, busyloop: bool) -> &mut Self
pub fn busyloop(&mut self, busyloop: bool) -> &mut Self
Block and return all the elements in a busy loop.
sourcepub fn state(&mut self, state: &'a str) -> &mut Self
pub fn state(&mut self, state: &'a str) -> &mut Self
Only return jobs in specified states. Can be called multiple times to get jobs in any of those states.