Open CR7273868 opened 6 days ago
Same could be suggested for Stack & Queue
Hi @CR7273868,
Can you elaborate on the request? Bag, Stack, and Queue are all completely non-blocking and lock-free, so an asynchronous method won't be needed.
Does "Async polling" mean a polling method returning true when there is an entry available? (like in typical channel data structures)
Hi @CR7273868,
Can you elaborate on the request? Bag, Stack, and Queue are all completely non-blocking and lock-free, so an asynchronous method won't be needed.
Does "Async polling" mean a polling method returning true when there is an entry available? (like in typical channel data structures)
Yes, exactly like polling for available items and then when something is available that it extracts. This might also prevent the need for Option
That's an interesting idea, and it will be possible to implement something like,
async fn poll(&self) -> T {
...
}
async fn timed_poll(&self, timeout: Duration) -> Option<T> {
...
}
Bag is all about pushing and popping. Having non blocking methods would make it more niche to put it in a while let Some(_) = bag.pop() {} loop.