eclipse-score / eclipse-score/communication
Add a buffered AsyncIterator helper struct
- Dominant language
- C++
- Stars
- 62
- Forks
- 97
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 72
Description
# Purpose
In most cases, receivers of event data just want a "stream of data" that comes from the event. We therefore want to add an API that enables a subscription to be turned into a Stream / AsyncIterator so that a task can be created which consumes data asynchronously.
# Outline
```rust
pub struct StreamingSubscription {}
impl std::async_iter::AsyncIterator for StreamingSubscription {
...
}
impl std::async_iter::IntoAsyncIterator for for S where S: Subscription {
type Item = T;
type IntoAsyncIter = StreamingSubscription;
...
}
```
Maybe we also need to say something about a buffer size or which buffer is to be used internally, maybe as an option for power users who want / need to control this.
Contributor guide
Assessment
This issue has not been assessed yet.