1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
//! Batch is a distributed task queue library.
//!
//! This library allows you to send a task to a RabbitMQ broker, so that a worker will be able
//! to pull it and execute the associated handler. It leverages the `futures` and `tokio-core`
//! crates to provide asynchronous I/O operations.
//!
//! # Example
//!
//! ```rust
//! #[macro_use]
//! extern crate batch;
//! extern crate futures;
//! extern crate serde;
//! #[macro_use]
//! extern crate serde_derive;
//! extern crate tokio_core;
//!
//! use batch::{exchange, job, ClientBuilder};
//! use futures::Future;
//! use tokio_core::reactor::Core;
//!
//! #[derive(Serialize, Deserialize, Task)]
//! #[task_routing_key = "hello-world"]
//! struct SayHello {
//! to: String,
//! }
//!
//! fn main() {
//! let mut core = Core::new().unwrap();
//! let handle = core.handle();
//!
//! let exchanges = vec![
//! exchange("batch.examples"),
//! ];
//! let client = ClientBuilder::new()
//! .connection_url("amqp://localhost/%2f")
//! .exchanges(exchanges)
//! .handle(handle)
//! .build();
//! let send = client.and_then(|client| {
//! let task = SayHello {
//! to: "Ferris".into(),
//! };
//!
//! job(task).exchange("batch.example").send(&client)
//! });
//!
//! core.run(send).unwrap();
//! }
//! ```
extern crate failure;
extern crate futures;
extern crate lapin_async;
extern crate lapin_futures as lapin;
extern crate lapin_futures_rustls as lapin_rustls;
extern crate lapin_futures_tls_api as lapin_tls_api;
extern crate log;
extern crate serde;
extern crate serde_derive;
extern crate serde_json;
extern crate tokio_core;
extern crate uuid;
extern crate wait_timeout;
extern crate batch_codegen;
pub use *;
use de;
use ser;
pub use ;
pub use Error;
pub use ;
pub use ;
pub use ;
pub use ;