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 haven't been able to find any documentation about how worker threads which don't interact directly with ruby objects are handled in terms of Drop. In my case I have existing rust code which establishes a long-running thread worker to handle incoming "jobs" via a channel. The thread "lives" in a struct that implements Drop, which tells the thread to stop waiting for new messages and terminate when it's dropped (glossing over details here). In this case, my expectation is the rust/ruru interface to ruby can cleanly send data (perhaps copied data) from ruby over the channel to the thread worker. Would the thread worker need to be setup with the Thread struct in ruru (Thread::call_without_gvl)? Or could I use std::thread? Will Drop be called when the parent struct is destroyed?
Thanks for any help you can provide.
The text was updated successfully, but these errors were encountered:
I haven't been able to find any documentation about how worker threads which don't interact directly with ruby objects are handled in terms of
Drop
. In my case I have existing rust code which establishes a long-running thread worker to handle incoming "jobs" via a channel. The thread "lives" in a struct that implementsDrop
, which tells the thread to stop waiting for new messages and terminate when it's dropped (glossing over details here). In this case, my expectation is the rust/ruru
interface to ruby can cleanly send data (perhaps copied data) from ruby over the channel to the thread worker. Would the thread worker need to be setup with theThread
struct inruru
(Thread::call_without_gvl
)? Or could I usestd::thread
? WillDrop
be called when the parent struct is destroyed?Thanks for any help you can provide.
The text was updated successfully, but these errors were encountered: