Skip to content

Conversation

@flora-hofmann-frequenz
Copy link
Collaborator

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=True returns a receiver that can be shared across multiple consumers. Here is information about the underlying GRPCBroadCaster definition.

Signed-off-by: Flora <[email protected]>
@github-actions github-actions bot added the part:docs Affects the documentation label Apr 1, 2025
@flora-hofmann-frequenz
Copy link
Collaborator Author

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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

cwasicki commented Apr 3, 2025

As @shsms pointed out here, we don't need two methods but just switch to return the receiver instead.

@flora-hofmann-frequenz
Copy link
Collaborator Author

@cwasicki: The function in PR #177 now just returns the receiver. This means I can close this PR, or do I get this wrong?

@cwasicki
Copy link
Contributor

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:docs Affects the documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants