A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/othiym23/async-listener below:

othiym23/async-listener: polyfill version of the 0.11 version of the asyncListener API

process.addAsyncListener polyfill

This is an implementation of Trevor Norris's process.{addAsyncListener,removeAsyncListener} API for adding behavior to async calls. You can see his implementation (currently a work in progress) on Node.js core pull request #6011. This polyfill / shim is intended for use in versions of Node prior to whatever version of Node in which Trevor's changes finally land (anticipated at the time of this writing as 0.11.7).

Here's his documentation of the intended API, which will probably get cleaned up here later:

createAsyncListener(callbacks[, initialStorage])

Returns a constructed AsyncListener object. Which can then be passed to process.addAsyncListener() and process.removeAsyncListener(). Each function parameter is as follows:

  1. callbacks: An Object which may contain four optional fields:
  2. initialStorage: A Value (i.e. anything) that will be, by default, attached to all new event instances. This will be overwritten if a Value is returned by create().
addAsyncListener(callbacks[, initialStorage]) addAsyncListener(asyncListener)

Returns a constructed AsyncListener object and immediately adds it to the listening queue.

removeAsyncListener(asyncListener)

Removes the asyncListener from the listening queue.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4