Async

platypus. Async

new Async(functions, callback) → {platypus.Async}

This class defines an asynchronous set up wherein multiple calls can be made and a final function will be run once the calls are completed. Something like Promise.all but better for avoiding garbage collection.

Source:
Parameters:
Name Type Description
functions Array

An array of functions where each function accepts a callback parameter and runs callback() on completion to notify the completion of the call.

callback function

The function to run once the list of functions has finished.

Returns:
Type:
platypus.Async

Returns the new Async object.

Methods

(static) recycle(async)

Returns an Async back to the cache.

Source:
Parameters:
Name Type Description
async platypus.Async

The Async to be recycled.

(static) setUp() → {platypus.Async}

Returns an Async from cache or creates a new one if none are available.

Source:
Returns:
Type:
platypus.Async

The instantiated Async.

attemptResolution() → {Boolean}

Attempts to resolve the async call immediately if possible.

Source:
Returns:
Type:
Boolean

Returns true if async is done, false if not.

recycle()

Relinquishes properties of the Async and recycles it.

Source: