Crates.io | eta_obj_pool |
lib.rs | eta_obj_pool |
version | 1.1.0 |
source | src |
created_at | 2025-03-06 11:22:36.249901+00 |
updated_at | 2025-03-06 11:36:01.283071+00 |
description | Thread safe object pool |
homepage | |
repository | |
max_upload_size | |
id | 1580985 |
size | 14,787 |
A simple thread safe object pool implementation in Rust.
use eta_obj_pool::pool::FixedPool;
let pool = FixedPool::new(vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10]).unwrap(); /// Or any vector of elements
for _ in 0..10 {
let element = pool.acquire().unwrap();
println!("{}", element.get());
}
The objects acquired from the proxies are automatically returned to the pool when they are dropped.