Add receiver method#161
Conversation
Signed-off-by: Flora <flora.hofmann@frequenz.com>
|
Please let me know if this is what you need in the application @cwasicki & @phillip-wenig-frequenz I'll still run a repo-config update, and then update the base branch here, but thought we could discuss already. |
| start: datetime | None, | ||
| end: datetime | None, | ||
| resampling_period: timedelta, | ||
| stream_as_receiver: bool = False, |
There was a problem hiding this comment.
I think the method should be split into two, one returning the receiver, and the other one calling the same but loops over the receiver and yields an iterator.
Probably this method should return the receiver and we add a new method e.g. iterate_aggregated_data that yields the iterator. There is a big drawback thought, which is that this would be a breaking change. Maybe there are better options?
|
@cwasicki: The function in PR #177 now just returns the receiver. This means I can close this PR, or do I get this wrong? |
Exactly, this one can be closed. |
Addresses Issue #155. This implementation introduces an option (
stream_as_receiver) to switch between using an AsyncIterator (default behavior) and a receiver.stream_as_receiver=Truereturns a receiver that can be shared across multiple consumers. Here is information about the underlying GRPCBroadCaster definition.