[−][src]Struct beanstalkc::Beanstalkc
Beanstalkc
provides beanstalkd client operations.
Methods
impl Beanstalkc
[src]
pub fn new() -> Beanstalkc
[src]
Create a new Beanstalkc
instance with default configs.
Default connection address is localhost:11300
pub fn host(self, host: &str) -> Self
[src]
Change host to beanstalkd server.
pub fn port(self, port: u16) -> Self
[src]
Change port to beanstalkd server.
pub fn connection_timeout(self, timeout: Option<Duration>) -> Self
[src]
Set timeout for TCP connection to beanstalkd server.
Default connection timeout is 120s
.
pub fn connect(self) -> Result<Self, BeanstalkcError>
[src]
Connect to a running beanstalkd server.
Examples
Basic usage
let conn = Beanstalkc::new().connect().unwrap();
With custom configurations
let mut conn = Beanstalkc::new() .host("127.0.0.1") .port(11300) .connection_timeout(Some(time::Duration::from_secs(5))) .connect() .unwrap();
pub fn reconnect(self) -> Result<Self, BeanstalkcError>
[src]
Re-connect to the beanstalkd server.
pub fn put_default(&mut self, body: &[u8]) -> Result<u64, BeanstalkcError>
[src]
Put a job into the current tube with default configs. Return job id.
pub fn put(
&mut self,
body: &[u8],
priority: u32,
delay: Duration,
ttr: Duration
) -> Result<u64, BeanstalkcError>
[src]
&mut self,
body: &[u8],
priority: u32,
delay: Duration,
ttr: Duration
) -> Result<u64, BeanstalkcError>
Put a job into the current tube and return the job id.
pub fn reserve(&mut self) -> Result<Job, BeanstalkcError>
[src]
Reserve a job from one of those watched tubes. Return a Job
object if it succeeds.
pub fn reserve_with_timeout(
&mut self,
timeout: Duration
) -> Result<Job, BeanstalkcError>
[src]
&mut self,
timeout: Duration
) -> Result<Job, BeanstalkcError>
Reserve a job with given timeout from one of those watched tubes.
Return a Job
object if it succeeds.
pub fn kick(&mut self, bound: u32) -> Result<u64, BeanstalkcError>
[src]
Kick at most bound
jobs into the ready queue.
pub fn kick_job(&mut self, job_id: u64) -> Result<(), BeanstalkcError>
[src]
Kick a specific job into the ready queue.
pub fn peek(&mut self, job_id: u64) -> Result<Job, BeanstalkcError>
[src]
Return a specific job.
pub fn peek_ready(&mut self) -> Result<Job, BeanstalkcError>
[src]
Return the next ready job.
pub fn peek_delayed(&mut self) -> Result<Job, BeanstalkcError>
[src]
Return the delayed job with the shortest delay left.
pub fn peek_buried(&mut self) -> Result<Job, BeanstalkcError>
[src]
Return the next job in the list of buried jobs.
pub fn do_peek(&mut self, cmd: Command) -> Result<Job, BeanstalkcError>
[src]
pub fn tubes(&mut self) -> Result<Vec<String>, BeanstalkcError>
[src]
Return a list of all existing tubes.
pub fn using(&mut self) -> Result<String, BeanstalkcError>
[src]
Return the tube currently being used.
pub fn use_tube(&mut self, name: &str) -> Result<String, BeanstalkcError>
[src]
Use a given tube.
pub fn watching(&mut self) -> Result<Vec<String>, BeanstalkcError>
[src]
Return a list of tubes currently being watched.
pub fn watch(&mut self, name: &str) -> Result<u64, BeanstalkcError>
[src]
Watch a specific tube.
pub fn ignore(&mut self, name: &str) -> Result<u64, BeanstalkcError>
[src]
Stop watching a specific tube.
pub fn stats(&mut self) -> Result<HashMap<String, String>, BeanstalkcError>
[src]
Return a dict of statistical information about the beanstalkd server.
pub fn stats_tube(
&mut self,
name: &str
) -> Result<HashMap<String, String>, BeanstalkcError>
[src]
&mut self,
name: &str
) -> Result<HashMap<String, String>, BeanstalkcError>
Return a dict of statistical information about the specified tube.
pub fn pause_tube(
&mut self,
name: &str,
delay: Duration
) -> Result<(), BeanstalkcError>
[src]
&mut self,
name: &str,
delay: Duration
) -> Result<(), BeanstalkcError>
Pause the specific tube for delay
time.
pub fn delete(&mut self, job_id: u64) -> Result<(), BeanstalkcError>
[src]
Delete job by job id.
pub fn release_default(&mut self, job_id: u64) -> Result<(), BeanstalkcError>
[src]
Release a reserved job back into the ready queue with default priority and delay.
pub fn release(
&mut self,
job_id: u64,
priority: u32,
delay: Duration
) -> Result<(), BeanstalkcError>
[src]
&mut self,
job_id: u64,
priority: u32,
delay: Duration
) -> Result<(), BeanstalkcError>
Release a reserved job back into the ready queue.
pub fn bury_default(&mut self, job_id: u64) -> Result<(), BeanstalkcError>
[src]
Bury a specific job with default priority.
pub fn bury(
&mut self,
job_id: u64,
priority: u32
) -> Result<(), BeanstalkcError>
[src]
&mut self,
job_id: u64,
priority: u32
) -> Result<(), BeanstalkcError>
Bury a specific job.
pub fn touch(&mut self, job_id: u64) -> Result<(), BeanstalkcError>
[src]
Touch a job by job_id
. Allowing the worker to request more time on a reserved
job before it expires.
pub fn stats_job(
&mut self,
job_id: u64
) -> Result<HashMap<String, String>, BeanstalkcError>
[src]
&mut self,
job_id: u64
) -> Result<HashMap<String, String>, BeanstalkcError>
Return a dict of statistical information about a job.
Trait Implementations
Auto Trait Implementations
impl Send for Beanstalkc
impl Sync for Beanstalkc
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
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>,