Deno.UnsafeCallback
UNSTABLE: Unsafe and new API, beware!
An unsafe function pointer for passing JavaScript functions as C function pointers to ffi calls.
The function pointer remains valid until the close()
method is called.
The callback can be explicitly ref'ed and deref'ed to stop Deno's process from exiting.
class UnsafeCallback<Definition extends UnsafeCallbackDefinition = UnsafeCallbackDefinition> { }
constructor(definition: Definition, callback: UnsafeCallbackFunction<Definition["parameters"], Definition["result"]>);
callback: UnsafeCallbackFunction<Definition["parameters"], Definition["result"]>;
definition: Definition;
pointer: bigint;
close(): void;
ref(): void;
unref(): void;
§Type Parameters
§
Definition extends UnsafeCallbackDefinition = UnsafeCallbackDefinition
[src]§Constructors
§Properties
§Methods
§
close(): void
[src]Removes the C function pointer associated with the UnsafeCallback. Continuing to use the instance after calling this object will lead to errors and crashes.
Calling this method will also immediately set the callback's reference counting to zero and it will no longer keep Deno's process from exiting.