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?
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.