[−][src]Struct beanstalkc::Job
Job
is a simple abstraction about beanstalkd job.
Methods
impl<'a> Job<'a>
[src]
pub fn new(
conn: &'a mut Beanstalkc,
job_id: u64,
body: String,
reserved: bool
) -> Job
[src]
conn: &'a mut Beanstalkc,
job_id: u64,
body: String,
reserved: bool
) -> Job
Initialize and return the Job
object.
pub fn id(&self) -> u64
[src]
Return job id.
pub fn body(&self) -> &str
[src]
Return job body.
pub fn reserved(&self) -> bool
[src]
Return job reserving status.
pub fn delete(&mut self) -> Result<(), BeanstalkcError>
[src]
Delete this job.
Example
use beanstalkc::Beanstalkc; let mut conn = Beanstalkc::new().connect().unwrap(); let mut job = conn.reserve().unwrap(); job.delete().unwrap();
pub fn release_default(&mut self) -> Result<(), BeanstalkcError>
[src]
Release this job back to the ready queue with default priority and delay.
Example
use beanstalkc::Beanstalkc; let mut conn = Beanstalkc::new().connect().unwrap(); let mut job = conn.reserve().unwrap(); job.release_default().unwrap();
pub fn release(
&mut self,
priority: u32,
delay: Duration
) -> Result<(), BeanstalkcError>
[src]
&mut self,
priority: u32,
delay: Duration
) -> Result<(), BeanstalkcError>
Release this job back to the ready queue with custom priority and delay.
Example
use std::time::Duration; use beanstalkc::Beanstalkc; let mut conn = Beanstalkc::new().connect().unwrap(); let mut job = conn.reserve().unwrap(); job.release(0, Duration::from_secs(0)).unwrap();
pub fn bury_default(&mut self) -> Result<(), BeanstalkcError>
[src]
Bury this job with default priority.
Example
use std::time::Duration; use beanstalkc::Beanstalkc; let mut conn = Beanstalkc::new().connect().unwrap(); let mut job = conn.reserve().unwrap(); job.bury_default().unwrap();
pub fn bury(&mut self, priority: u32) -> Result<(), BeanstalkcError>
[src]
Bury this job with custom priority.
Example
use std::time::Duration; use beanstalkc::Beanstalkc; let mut conn = Beanstalkc::new().connect().unwrap(); let mut job = conn.reserve().unwrap(); job.bury(1024).unwrap();
pub fn kick(&mut self) -> Result<(), BeanstalkcError>
[src]
Kick this job to ready queue.
Example
use std::time::Duration; use beanstalkc::Beanstalkc; let mut conn = Beanstalkc::new().connect().unwrap(); let mut job = conn.peek_buried().unwrap(); job.kick().unwrap();
pub fn touch(&mut self) -> Result<(), BeanstalkcError>
[src]
Touch this reserved job, requesting more time to work on it.
Example
use std::time::Duration; use beanstalkc::Beanstalkc; let mut conn = Beanstalkc::new().connect().unwrap(); let mut job = conn.reserve().unwrap(); job.touch().unwrap();
pub fn stats(&mut self) -> Result<HashMap<String, String>, BeanstalkcError>
[src]
Return a dict of statistical information about this job.
Example
use std::time::Duration; use beanstalkc::Beanstalkc; let mut conn = Beanstalkc::new().connect().unwrap(); let mut job = conn.peek_ready().unwrap(); let job_stats = job.stats().unwrap(); dbg!(job_stats);
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,