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
Is there any possibility that we could support multi-threaded code from Ruby call (As the example I showed)
My thought was like this: in the send_command / send_reply data send from Ruby via PipeToJs, we add a session_id field to identify the session (The session_id is stay the same for multiple send_command / send_reply back-forth in one Ruby initiate Jscall.exec)
When the Ruby side Pipe receive the data in one thread (there could multiple threads initiate Jscall.exec with different session), the thread only fetch data in Pipe who has the same session_id. (Like a Messaging Queue, receiver only subscribe the specific topic)
For the JS side Pipe, it can process all session_id data in the same main_loop. But the process should be non-block via JS concurrency.
The Pipe between JS & Ruby is the shared resource. So multiple session can use the Pipe together with mutex and topic subscribe.
When ruby code use Jscall, if the Ruby use multi-thread concurrent, the Jscall will be failed.
The text was updated successfully, but these errors were encountered: