Consider allowing to add/remove receivers from Select dynamically
#24
Closed
leandro-lucarella-frequenz
started this conversation in
Ideas
Replies: 3 comments
|
This will probably be closed in favor of #29, as we don't want to add new ways to misuse |
0 replies
|
We will not pursue this feature and improve documentation (#29) to make it clear that |
0 replies
|
The current proposal is to implement this externally, by adding support to add/remove channels to a |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
We have some use cases where we need to add/remove receivers to a
Selectinside the.ready()loop. For now we need to create a second loop whereSelectis created, thenbreakthe inside (.ready()) loop and re-generate theSelectobject, which is inconvenient from the POV of the code, and also makes the code harder to read, as the flow becomes more complicated.Another big issue with this approach is if it's not done very carefully, we can lose messages from receivers if the
breakis done before all available messages from all receivers in the current loop are not handled. Thebreakshould always be the last in the loop.This also applies to
MergeandMergeNamed.Example:
https://github.com/frequenz-floss/frequenz-sdk-python/blob/4ce090ce32f539014101f145e8f97fc67990fa9e/src/frequenz/sdk/data_ingestion/microgrid_data.py#L229-L260
Other use case came from here:
All reactions