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
The asynchronous API is efficient and flexible, but coding would be simpler with some synchronous API, with no need for callbacks defined by an application.
A code using the synchronous API would look something like this:
for the threads running the main loop synchronous calls would be implemented by recursive calls to mainloop.loop(). A special 'SyncMethodExit' exception could be used to exit such recursive loop calls
other threads would just wait for some event
a generic wrapper could be made for asynchronous calls taking a callback and error_callback arguments. The wrapper would require access to the main loop. In case of calls which take a Client instance as the first argument client.loop could be used. Or maybe we should use thread-local storage to pass the current loop object?
The text was updated successfully, but these errors were encountered:
The asynchronous API is efficient and flexible, but coding would be simpler with some synchronous API, with no need for callbacks defined by an application.
A code using the synchronous API would look something like this:
Some ideas for implementation:
callback
anderror_callback
arguments. The wrapper would require access to the main loop. In case of calls which take aClient
instance as the first argument client.loop could be used. Or maybe we should use thread-local storage to pass the current loop object?The text was updated successfully, but these errors were encountered: