Skip to main content
method Deno.UnsafeCallback.threadSafe

Creates an UnsafeCallback and calls ref() once to allow it to wake up the Deno event loop when called from foreign threads.

This also stops Deno's process from exiting while the callback still exists and is not unref'ed.

Parameters

definition: Const<Definition>
callback: UnsafeCallbackFunction<Definition["parameters"], Definition["result"]>