EventLoop.post

void post(scope void delegate() @safe nothrow callback) @trusted nothrow

Post a callback from any thread for execution on the loop thread.

post() is safe to call from any thread. It appends the callback to a mutex-protected queue and wakes the event loop. The callback is drained into the defer queue and executed on the next loop iteration.

The internal wakeup handle is created lazily on first call.

Parameters

callbackFunction to execute on the loop thread.