Constructor
new Agent(ingate, outgate)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
ingate |
Gate
|
Input gate |
outgate |
Gate
|
Object.<string, Gate>
|
Output gate or its map |
Methods
(static) all() → {Promise}
Start all agents
- Source:
Parameters:
Name | Type | Description |
---|---|---|
...agents |
Agent
|
Agent(s) |
Returns:
- Type:
-
Promise
A Promise that resolves when all agents have done
(static) create(ingate, outgate, main) → {Agent}
Shorthand to create Agent
- Source:
Parameters:
Name | Type | Description |
---|---|---|
ingate |
Gate
|
Input gate |
outgate |
Gate
|
Object.<string, Gate>
|
Output gate or its map |
main |
Promise
|
Process main Promise function |
(async) after()
Processes should be defined after all transactions
- Source:
(async) before()
Processes should be defined before all transactions
- Source:
(async) main(item, outgates) → {object|array}
Process main Promise function
- Source:
Parameters:
Name | Type | Description |
---|---|---|
item |
object
|
read item |
outgates |
Array.<OutputGate>
|
Output gates |
Returns:
- Type:
-
object
|array
written item(s). it is an array if output is plural. undefined
iss not written.