A pool of objects.
After an object is taken from the pool, it is returned to the pool when it is dropped.
Pool items must be passed on creation by values:
let pool = autoreturn_pool::Pool::new([1, 2]);
let item = pool.take();
with custom config:
let config = autoreturn_pool::Config {
wait_duration: std::time::Duration::from_millis(5),
};
let pool = autoreturn_pool::Pool::with_config(config, [1, 2]);
let item = pool.take();
Take an object from the pool.
If the pool is empty, the method will wait for the object to be returned to the pool.
If the wait duration is exceeded, the method will return None.