waitmap icon indicating copy to clipboard operation
waitmap copied to clipboard

Remove entries from the WaitMap

Open ebkalderon opened this issue 5 years ago • 0 comments

Currently, the number of entries in the map will grow without bound, which is fine for some applications but not others. It would be nice if there was a way to remove entries from the WaitMap after waiting for them.

For example, a hypothetical wait_and_remove() method could await the value being inserted, similar to the existing wait() method, but instead of the future resolving to an Option<Ref<'_, K, V>>, it would instead resolve to an owned Option<(K, V)>, removing the entry from the map as soon as it is inserted.

ebkalderon avatar Apr 29 '20 12:04 ebkalderon