You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes asynchronous options are not available for handling a request, to handle these cases it would be useful to be able to register regular functions as handlers instead of co-routines.
Update the Registry class to allow synchronous functions to be subscribed to requests, and wrap them in a thread pool before registering via loop.run_in_executor.
These synchronous handlers would also need a synchronous wrapper around the MessageBus class to then further publish events.
This will need additional work and documentation around the injector integration to minimise problems with sharing resources between threads.
The text was updated successfully, but these errors were encountered:
Description
Allow registering regular functions as handlers.
Context
Sometimes asynchronous options are not available for handling a request, to handle these cases it would be useful to be able to register regular functions as handlers instead of co-routines.
Possible implementation
Update the
Registry
class to allow synchronous functions to be subscribed to requests, and wrap them in a thread pool before registering via loop.run_in_executor.These synchronous handlers would also need a synchronous wrapper around the
MessageBus
class to then further publish events.This will need additional work and documentation around the injector integration to minimise problems with sharing resources between threads.
The text was updated successfully, but these errors were encountered: