method Deno.UnsafeCallback.threadSafe
Jump to headingUnsafeCallback.threadSafe<Definition extends UnsafeCallbackDefinition = UnsafeCallbackDefinition>(definition: Definition,callback: UnsafeCallbackFunction<Definition["parameters"], Definition["result"]>,): UnsafeCallback<Definition>
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.
Type Parameters Jump to heading
Jump to headingDefinition extends UnsafeCallbackDefinition = UnsafeCallbackDefinition
Parameters Jump to heading
Jump to headingdefinition: Definition
Jump to headingcallback: UnsafeCallbackFunction<Definition["parameters"], Definition["result"]>