new Async()
- Source:
Methods
done(cb)
- Source:
register a callback to be called when processing is done
Parameters:
Name | Type | Description |
---|---|---|
cb |
function |
errors() → {Array.<Error>}
- Source:
return all errors found in responses
Returns:
- Type
- Array.<Error>
flush()
- Source:
reset operation processing
index() → {string}
- Source:
return unique index identifier for an operation
Returns:
- Type
- string
processing() → {number}
- Source:
return how many operations are processing right now
Returns:
- Type
- number
receive(id, args) → {boolean}
- Source:
method used for return result for an operation,
returns true
if value was accepted.
if operation already obtained a value
then value is not accepted and it returns false
Parameters:
Name | Type | Description |
---|---|---|
id |
string | obtained from |
args |
any |
Returns:
- Type
- boolean
reserve() → {string}
- Source:
require to reserve index async.Async#index
for an additional operation
Returns:
- Type
- string
responses(returnUnknownResponsesopt) → {Array.<Array.<any>>}
- Source:
return operations' responses
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
returnUnknownResponses |
boolean |
<optional> |
false
|
Returns:
run(func, args, context) → {string}
- Source:
require to run an operation
Parameters:
Name | Type | Description |
---|---|---|
func |
function | function that should be executed |
args |
Array.<any> | |
context |
object |
Returns:
- Type
- string
wait()
- Source:
require to wait an additional operation
Type Definitions
Operation
- Source:
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
0 |
async.Async.OperationCallback |
<optional> |
|
1 |
async.Async.OperationArgs |
<optional> |
|
2 |
async.Async.OperationContext |
<optional> |
|
3 |
async.Async.OperationCallbackIndex |
<optional> |
Type:
- object
OperationArgs
- Source:
list if arguments passed to OperationCallback
.
Type:
- Array.<any>
OperationCallback()
- Source:
a function that represents the operation itself, it have as argument next
callback, by default it is first.
OperationCallbackIndex
- Source:
index of next()
callback in list of OperationCallback
's arguments. Default value is 0
.
Type:
- number
OperationContext
- Source:
context that should be used in OperationCallback
. Default value is {}
.
Type:
- object
Operations
- Source: