Threading subscription notifications #1666
MaciejPMarciniak
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
mixing threads and asyncio is kind of a mess... what i did in the past is using asyncio.Queue within the SubHandler and process the queue in a workerprocesspool |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, it's my first suggestion here, let me know if anything can be clarified or provided in a better format :)
Datachange_notification and event_notification usually involve operations like storing new data to the existing databases. These are usually expensive and/or time consuming, depending on the volume of the accessed data. In the provided examples, there is a note about handling such operations in separate threads, yet it is not clear at all how the new threads would affect the main thread loop in case of status changes and other server-related events, such that all threads exit gracefully.
Suggestion:
Assign threads for notifications by default, to allow for more complex activities within the notification methods.
Beta Was this translation helpful? Give feedback.
All reactions