tcc_callback_async_drain: Drain the async callback queue

View source: R/callbacks.R

tcc_callback_async_drainR Documentation

Drain the async callback queue

Description

Execute any pending async callbacks immediately on the main R thread. Normally callbacks fire automatically via R's event loop (input handler on POSIX, message pump on Windows), so explicit draining is only needed in test harnesses or tight batch loops that never yield to R's event loop.

Usage

tcc_callback_async_drain()

Details

TCC-compiled C code that is known to be running on the main R thread can call RC_callback_async_drain_c() directly instead of returning to R. Functions bound with ⁠callback_async:*⁠ arguments are normally executed on a worker by the generated wrapper while the main thread drains, so user code in that target function should not assume it is itself on the main thread.

Value

NULL (invisible)


Rtinycc documentation built on July 26, 2026, 1:06 a.m.