node-addon-layer
C API For writing Node modules
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Typedefs | Functions
Async methods

Typedefs

typedef struct shim_work_s shim_work_t
 Opaque pointer to the queued work.
 
typedef void(* shim_work_cb )(shim_work_t *, void *)
 
typedef void(* shim_after_work )(shim_ctx_t *, shim_work_t *, int, void *)
 

Functions

void shim_queue_work (shim_work_cb, shim_after_work, void *hint)
 

Detailed Description

Methods for asynchronous function calling

Typedef Documentation

typedef void(* shim_after_work)(shim_ctx_t *, shim_work_t *, int, void *)

Callback on main thread to return to JS

typedef void(* shim_work_cb)(shim_work_t *, void *)

Callback on a different thread to do computation

Function Documentation

void shim_queue_work ( shim_work_cb  work_cb,
shim_after_work  after_cb,
void *  hint 
)

Queue work to be done on background thread

Parameters
work_cbCallback that will be called on a different thread
after_cbCallback that will be called on the main thread
hintArbitrary data to be passed to both callbacks