Deadpool is a dead simple async pool for connections and objects of any type.
This crate implements a deadpool manager for [fantoccini
].
```rust use deadpool_fantoccini::{Manager, Pool, PoolShutdown}; use fantoccini::{ClientBuilder, Locator};
async fn main() { let manager = Manager::new("http://localhost:4444", fantoccini::ClientBuilder::native()); let pool = Pool::builder(manager) .max_size(5) .build() .unwrap();
let mut client = pool.get().await.unwrap();
client.goto("http://example.org/").await.unwrap();
let title = client.find(Locator::Css("h1")).await.unwrap().text().await.unwrap();
assert_eq!(title, "Example Domain");
drop(client);
// cleanly closes all sessions (all sessions have to be returned to the pool beforehand.)
pool.shutdown().await.unwrap();
} ```
Licensed under MIT license (LICENSE or http://opensource.org/licenses/MIT)