Skip to content

Commit

Permalink
Fix readme example
Browse files Browse the repository at this point in the history
  • Loading branch information
svblsvljb authored and djc committed Aug 31, 2022
1 parent 098e95d commit 1246142
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,22 @@ Backend | Adapter Crate
Using an imaginary "foodb" database.

```rust
fn main() {
#[tokio::main]
async fn main() {
let manager = bb8_foodb::FooConnectionManager::new("localhost:1234");
let pool = bb8::Pool::builder()
.max_size(15)
.build(manager)
.await
.unwrap();

for _ in 0..20 {
let pool = pool.clone();
tokio::spawn(move || {
tokio::spawn(async move {
let conn = pool.get().await.unwrap();
// use the connection
// it will be returned to the pool when it falls out of scope.
})
});
}
}
```
Expand Down

0 comments on commit 1246142

Please sign in to comment.