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
//! A connection pool implementation for tokio
//!
//! [Documentation](https://docs.rs/tk-pool) |
//! [Github](https://github.com/tailhook/tk-pool) |
//! [Crate](https://crates.io/crates/tk-pool) |
//! [Examples](https://github.com/tailhook/tk-pool/tree/master/examples)
//!
//! A connection pool implementation for tokio. Main features:
//!
//! 1. Works for any request-reply protocol (actually for any `Sink`)
//! 2. Provides both queue and pushback if needed
//! 3. Allows pipelining (multiple in-flight request when multiplexing)
//! 4. Auto-reconnects on broken connection
//! 5. Adapts when DNS name change
//!
//! Multiple load-balancing strategies are in to do list.
//!
//! # Example
//!
//! ```rust,ignore
//!
//! let mut pool =
//! pool_for(|addr| connect(addr))
//! .connect_to(ns.subscribe_many(address, default_port))
//! .lazy_uniform_connections(2)
//! .with_queue_size(10)
//! .spawn_on(&core.handle());
//!
//! ```
//!
extern crate log;
extern crate abstract_ns;
extern crate futures;
extern crate rand;
extern crate tokio_core;
extern crate void;
pub use pool_for;
pub use Connect;