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.
Parameters:
Name | Type | Description |
---|---|---|
functions |
Array
|
An array of functions where each function accepts a |
callback |
function
|
The function to run once the list of functions has finished. |
Methods
(static) recycle(async)
Returns an Async back to the cache.
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.
attemptResolution() → {Boolean}
Attempts to resolve the async call immediately if possible.
Returns:
- Type:
-
Boolean
Returns true
if async is done, false
if not.