Create a thread-safe callback that can be invoked from any thread.
Important: Call .release() when the callback is no longer needed. Like a timer, it keeps the Node.js event loop alive until released, unless .unref() is called.
.release()
.unref()
JavaScript function to wrap
Return type of the callback
Optional
Argument types
Create a thread-safe callback that can be invoked from any thread.
Important: Call
.release()when the callback is no longer needed. Like a timer, it keeps the Node.js event loop alive until released, unless.unref()is called.