-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Asynchronous management of events #26
Comments
I will be working on threads and thread locking |
While making events asynchronous we should also look into multi-threading in general. The two places where multithreading is needed are:
For both the above we need to make sure that both the sunfish core library and the event interface are thread safe. This includes that the storage backends are also thread safe. |
A way of working towards thread safe-ness is to use a database for storing the redfish tree. We should evaluate a couple of alternatives:
|
I have been evaluating the usage of python threads vs adopting the newer asyncio library. I personally prefer using asyncio because it is better integrated with python and allows us to catch exceptions from asynchronous co-routines. Unlike threads where exceptions can be caught only the a join is executed on the main thread. Implementation with threads is already available but lacks catching the above mentioned exceptions. On the other hand switching to an asyncio based implementation would require a substantial overhaul of the entire library as most of the plugins and functionalities would have to adopt the asynchronous pattern. |
When the sunfish core receives an event it handles it synchronously and the event sender waits for the entire time it gets processed. Events should return immediately for the client and be processed by a thread (or similar).
The text was updated successfully, but these errors were encountered: