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
Currently, the later::later() C function can be used by a background thread to schedule code to run on the main R thread. However, we don't have a way for the main thread to safely pass messages to the background thread, or to schedule functions to run on the background thread. This is a pattern that's used in httpuv and will be used in websocket. We should consider adding functionality to later that makes it easier to do these things.
(Note: there is the BackgroundThread class, but that launches a thread, runs a function on the new thread, and when that function finishes, it schedules a function to run on the main R thread and then closes the thread. This is fine for threads that do one task and then stop, but it isn't usable for threads that need to persist, like ones in httpuv and websocket that handle network I/O.)
The text was updated successfully, but these errors were encountered:
Hi @wch. Do you have any tips on how to do that using current version of the later package? In my case background thread should handle I/O - answer heartbeats and send data from R.
Currently, the
later::later()
C function can be used by a background thread to schedule code to run on the main R thread. However, we don't have a way for the main thread to safely pass messages to the background thread, or to schedule functions to run on the background thread. This is a pattern that's used in httpuv and will be used in websocket. We should consider adding functionality to later that makes it easier to do these things.(Note: there is the
BackgroundThread
class, but that launches a thread, runs a function on the new thread, and when that function finishes, it schedules a function to run on the main R thread and then closes the thread. This is fine for threads that do one task and then stop, but it isn't usable for threads that need to persist, like ones in httpuv and websocket that handle network I/O.)The text was updated successfully, but these errors were encountered: