Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/schickling/rust-beanstalkd
Easy-to-use beanstalkd client for Rust (IronMQ compatible)
https://github.com/schickling/rust-beanstalkd
Last synced: 24 days ago
JSON representation
Easy-to-use beanstalkd client for Rust (IronMQ compatible)
- Host: GitHub
- URL: https://github.com/schickling/rust-beanstalkd
- Owner: schickling
- License: apache-2.0
- Created: 2014-12-06T15:15:57.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2021-11-24T00:47:52.000Z (about 3 years ago)
- Last Synced: 2024-12-10T21:25:51.501Z (about 1 month ago)
- Language: Rust
- Homepage: http://schickling.me/rust-beanstalkd
- Size: 572 KB
- Stars: 46
- Watchers: 1
- Forks: 15
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
- awesome-rust-cn - schickling/rust-beanstalkd - ci.org/schickling/rust-beanstalkd.svg?branch=master">](https://travis-ci.org/schickling/rust-beanstalkd) (Libraries / Distributed systems)
- awesome-rust - schickling/rust-beanstalkd - ci.org/schickling/rust-beanstalkd.svg?branch=master">](https://travis-ci.org/schickling/rust-beanstalkd) (Libraries / Distributed systems)
- awesome-rust-cn - schickling/rust-beanstalkd
- awesome-rust-zh - schickling/rust-beanstalkd - [Beanstalkd](https://github.com/beanstalkd/beanstalkd)绑定 [<img src="https://api.travis-ci.org/schickling/rust-beanstalkd.svg?branch=master">](https://travis-ci.org/schickling/rust-beanstalkd) (库 / 分布式系统)
- awesome-rust - schickling/rust-beanstalkd - ci.org/schickling/rust-beanstalkd.svg?branch=master">](https://travis-ci.org/schickling/rust-beanstalkd) (库 Libraries / 分布式系统 Distributed systems)
README
rust-beanstalkd [![Build Status](https://travis-ci.org/schickling/rust-beanstalkd.svg)](https://travis-ci.org/schickling/rust-beanstalkd)
===============
[![Crates.io](https://img.shields.io/crates/v/beanstalkd.svg)](https://crates.io/crates/beanstalkd)Easy-to-use beanstalkd client for Rust (IronMQ compatible)
## Install
Add this dependency to your `Cargo.toml`
```toml
beanstalkd = "*"
```## Documentation
More documentation can be found [here](https://docs.rs/beanstalkd).
## Usage
#### Producer
```rs
extern crate beanstalkd;use beanstalkd::Beanstalkd;
fn main() {
let mut beanstalkd = Beanstalkd::localhost().unwrap();
let _ = beanstalkd.put("Hello World", 0, 0, 10000);
}
```#### Consumer
```rs
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
```rs
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
Licensed under either of
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)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.