Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A pool-like collection that automatically returns objects to the pool & blocks when the pool is empty

License

Notifications You must be signed in to change notification settings

evanjpw/pseudo_pool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pseudo_pool

License Cargo Documentation Build

A pool-like collection that automatically returns objects to the pool & blocks when the pool is empty

Motivation

I needed something that worked like a pool, that allowed me to checkout objects in the pool & then return them, but it needed to have the following characteristics:

  • It needed to automatically return things to the pool when dropped
  • It needed to have a non-blocking way to do checkout that returned an object or None if all objects are in use
  • IT NEEDED TO ALSO HAVE A BLOCKING CHECKOUT THAT BLOCKS UNTIL THERE IS A USABLE OBJECT

The first two were covered by existing crates:

These are nice crates made by responsible people, & not absurd hacks like this crate.

However, none of them had characteristic three.

So I wrote this thing.

Usage

[dependencies]
pseudo_pool = "0.1.0" # A version number that inspires confidence

Examples

TBD

Benchmarks

No.

License

MIT

About

A pool-like collection that automatically returns objects to the pool & blocks when the pool is empty

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages