BlockingObjectPool
A thread safe, blocking, object pool in rust.
Summary
BlockingObjectPool::with_capacity
orBlockingObjectPool::with_objects
to initialize a poolpool.get
to obtain a object from the pool
If the pool is empty, get
will be blocked.
If the object is out of scope, it's been put back to the pool automatically.
That's all!
Examples
extern crate blocking_object_pool;
use BlockingObjectPool;
Inspired by zslayton's lifeguard.