new CompositeFuture()
- Source:
Methods
cause(index) → {todo}
Parameters:
| Name | Type | Description |
|---|---|---|
index |
number | the wrapped future index |
- Source:
Returns:
- Type
- todo
compose(mapper) → {Future}
mapper function.
When this future (the one on which compose is called) succeeds, the mapper will be called with
the completed value and this mapper returns another future object. This returned future completion will complete
the future returned by this method call.
If the mapper throws an exception, the returned future will be failed with this exception.
When this future fails, the failure will be propagated to the returned future and the mapper
will not be called.
Parameters:
| Name | Type | Description |
|---|---|---|
mapper |
function | the mapper function |
- Source:
Returns:
- Type
- Future
failed(index) → {boolean}
Parameters:
| Name | Type | Description |
|---|---|---|
index |
number | the wrapped future index |
- Source:
Returns:
- Type
- boolean
getHandler() → {function}
- Source:
Returns:
- Type
- function
isComplete(index) → {boolean}
Parameters:
| Name | Type | Description |
|---|---|---|
index |
number | the wrapped future index |
- Source:
Returns:
- Type
- boolean
map(mapper) → {Future}
mapper function on this future.
When this future succeeds, the mapper will be called with the completed value and this mapper
returns a value. This value will complete the future returned by this method call.
If the mapper throws an exception, the returned future will be failed with this exception.
When this future fails, the failure will be propagated to the returned future and the mapper
will not be called.
Parameters:
| Name | Type | Description |
|---|---|---|
mapper |
function | the mapper function |
- Source:
Returns:
- Type
- Future
otherwise(value) → {Future}
value.
When this future fails, this value will complete the future returned by this method call.
When this future succeeds, the result will be propagated to the returned future.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
CompositeFuture | the value that eventually completes the mapped future |
- Source:
Returns:
- Type
- Future
otherwiseEmpty() → {Future}
null.
This is a convenience for future.otherwise((T) null).
When this future fails, the null value will complete the future returned by this method call.
When this future succeeds, the result will be propagated to the returned future.
- Source:
Returns:
- Type
- Future
recover(mapper) → {Future}
Parameters:
| Name | Type | Description |
|---|---|---|
mapper |
function | A function which takes the exception of a failure and returns a new future. |
- Source:
Returns:
- Type
- Future
result() → {CompositeFuture}
- Source:
Returns:
- Type
- CompositeFuture
resultAt(index) → {Object}
Parameters:
| Name | Type | Description |
|---|---|---|
index |
number | the wrapped future index |
- Source:
Returns:
- Type
- Object
setHandler(handler) → {CompositeFuture}
Parameters:
| Name | Type | Description |
|---|---|---|
handler |
function |
- Source:
Returns:
- Type
- CompositeFuture
size() → {number}
- Source:
Returns:
- Type
- number
succeeded(index) → {boolean}
Parameters:
| Name | Type | Description |
|---|---|---|
index |
number | the wrapped future index |
- Source:
Returns:
- Type
- boolean