You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the feature you'd like
Add a monadic interface for handling obtaining objects from a pool
Additional context
Currently when a pool is empty - no items available - it's up to the user to write all the code and conditions to deal with that case.
Retrieving an object from the pool can also be a little expensive since it needs to be wrapped in a PoolItem object.
I propose an interface that would allow users to pass a lambda for each situation - item acquired or not (pool empty), something like
auto pool = dxpool::StaticPool<ItemType, 1>();
auto itemPresentLambda = [](ItemType& item){...};
auto poolEmptyLambda = [](){...};
pool
.Get(itemPresentLambda).
.OrElse(poolEmptyLambda();
The text was updated successfully, but these errors were encountered:
Describe the feature you'd like
Add a monadic interface for handling obtaining objects from a pool
Additional context
Currently when a pool is empty - no items available - it's up to the user to write all the code and conditions to deal with that case.
Retrieving an object from the pool can also be a little expensive since it needs to be wrapped in a
PoolItem
object.I propose an interface that would allow users to pass a lambda for each situation - item acquired or not (pool empty), something like
The text was updated successfully, but these errors were encountered: