#object-pool #blocks #waiting

block_pool

Object pool that blocks when waiting for an object

3 releases

0.1.2 Dec 6, 2021
0.1.1 Dec 3, 2021
0.1.0 Dec 3, 2021

#16 in #waiting

MIT license

4KB
53 lines

block_pool

A simple object pool that blocks when taking an item out.

use block_pool::Pool;

let pool = Pool::new(vec![1, 2, 3]);
let mut item = pool.take();
*item += 1;
drop(item);

License: MIT


lib.rs:

A simple object pool that blocks when taking an item out.

use block_pool::Pool;

let pool = Pool::new(vec![1, 2, 3]);
let mut item = pool.take();
*item += 1;
drop(item);

No runtime deps