waitmap
waitmap copied to clipboard
Remove entries from the WaitMap
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.