#queue #worker #ironmq

beanstalkd

Easy-to-use beanstalkd client for Rust (IronMQ compatible)

12 releases

Uses old Rust 2015

0.4.1 May 31, 2018
0.3.2 Feb 23, 2015
0.2.4 Jan 23, 2015
0.1.0 Jan 22, 2015
0.0.1 Dec 7, 2014

#853 in Network programming

Download history 12/week @ 2023-10-23 31/week @ 2023-10-30 11/week @ 2023-11-06 20/week @ 2023-11-13 25/week @ 2023-11-20 51/week @ 2023-11-27 17/week @ 2023-12-04 9/week @ 2023-12-11 22/week @ 2023-12-18 44/week @ 2023-12-25 5/week @ 2024-01-01 11/week @ 2024-01-08 9/week @ 2024-01-15 21/week @ 2024-01-22 55/week @ 2024-01-29 11/week @ 2024-02-05

97 downloads per month
Used in 2 crates

MIT/Apache

14KB
290 lines

rust-beanstalkd Build Status

Easy-to-use beanstalkd client for Rust (IronMQ compatible)

Install

Add this dependency to your Cargo.toml

beanstalkd = "*"

Documentation

More documentation can be found here.

Usage

Producer

extern crate beanstalkd;

use beanstalkd::Beanstalkd;

fn main() {
    let mut beanstalkd = Beanstalkd::localhost().unwrap();
    let _ = beanstalkd.put("Hello World", 0, 0, 10000);
}

Consumer

extern crate beanstalkd;

use beanstalkd::Beanstalkd;

fn main() {
    let mut beanstalkd = Beanstalkd::localhost().unwrap();
    let (id, body) = beanstalkd.reserve().unwrap();
    println!("{}", body);
    let _ = beanstalkd.delete(id);
}

IronMQ example

extern crate beanstalkd;

use beanstalkd::Beanstalkd;

fn main() {
    let host = "mq-aws-us-east-1.iron.io";
    let token = "your token";
    let project_id = "your project id - not the name";

    let mut beanstalkd = Beanstalkd::connect(host, 11300).unwrap();
    let _ = beanstalkd.put(format!("oauth {} {}", token, project_id).as_slice(), 0, 0, 10000);
    let _ = beanstalkd.put("Hello World", 0, 0, 10000);
}

License

MIT License

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~11KB