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
I'm curious if there's been any discussion of a single-threaded mode for when using an event loop.
We would like to integrate with our (private) event loop instead of using a threaded model.
While the existing SetEventLoop callbacks work great for my needs (which is just publishing to a jetstream stream, no need for replies or any other stuff), with SendASAP set, this all falls apart during reconnection handling, where the reconnection happens off thread. This includes ping interval processing.
The example libuv code (thank you for writing this!) goes through some gymnastics to make sure the reconnection is processed back on the main event thread safely, but this would all be much simpler if for example, the event loop could process the timers itself rather than on the thread.
I'm not quite clear on the asyncCB and GC threads, but apparently I haven't hit them actually being used yet.
Use case
See above.
Contribution
I don't think I understand the core code well enough.
The text was updated successfully, but these errors were encountered:
This is very classic single-threaded use case, with a busy event loop, error callback and timer handle in main thread can speed up a lot, and much fast without lock. also be able to handle a lot connection.
And when there is an error, the callback should be able to handle the original message/request with context. (let user decide what to do, or auto resent when reconnected)
There are many libraries available for reference, such as libzmq, rdkafaka.
Proposed change
I'm curious if there's been any discussion of a single-threaded mode for when using an event loop.
We would like to integrate with our (private) event loop instead of using a threaded model.
While the existing SetEventLoop callbacks work great for my needs (which is just publishing to a jetstream stream, no need for replies or any other stuff), with SendASAP set, this all falls apart during reconnection handling, where the reconnection happens off thread. This includes ping interval processing.
The example libuv code (thank you for writing this!) goes through some gymnastics to make sure the reconnection is processed back on the main event thread safely, but this would all be much simpler if for example, the event loop could process the timers itself rather than on the thread.
I'm not quite clear on the asyncCB and GC threads, but apparently I haven't hit them actually being used yet.
Use case
See above.
Contribution
I don't think I understand the core code well enough.
The text was updated successfully, but these errors were encountered: