`SWIG/Examples/javascript/native/`

## Manually wrapped callback function in JavaScript

This example demonstrates how to manually add callback feature support to a SWIG module.

- example.i. Interface file containing the API function and async behind-the-scenes functions.
- runme.js. Sample JavaScript program showing the API function being called with a callback function parameter.

## Notes

The V8 code queues the callback request for processing using the UV interface. An async function callback is invoked when the system is ready to process the next request. When the async function finishes, a completion function callback is invoked to finalize the request. Here the callback function parameter is invoked.
UV request queueing is only necessary for operations that would take a really long or otherwise unpredictable amount of time (async operations). A callback parameter could also be invoked immediately within the API function.