Consider allowing to add/remove receivers from Select dynamically
              
              #24
            
            Replies: 3 comments
-
| This will probably be closed in favor of #29, as we don't want to add new ways to misuse  | 
Beta Was this translation helpful? Give feedback.
-
| We will not pursue this feature and improve documentation (#29) to make it clear that  | 
Beta Was this translation helpful? Give feedback.
-
| The current proposal is to implement this externally, by adding support to add/remove channels to a  | 
Beta Was this translation helpful? Give feedback.
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:
Beta Was this translation helpful? Give feedback.
All reactions