|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD |
public interface PromiseFactory
An interface capable of creating Promise instances. The Promises static methods use this interface to create promises. The default Promise creation mechanism can be overriden by setting Promises.setPromiseFactory
Method Summary | |
---|---|
void
|
addPromiseDecoratorLookupStrategy(PromiseDecoratorLookupStrategy lookupStrategy)
Adds a PromiseDecoratorLookupStrategy. |
groovy.lang.Closure
|
applyDecorators(groovy.lang.Closure c, java.util.List decorators)
Applies the registered decorators to the given closure |
Promise
|
createBoundPromise(java.lang.Object value)
Creates a promise with a value pre-bound to it |
Promise
|
createPromise(java.util.Map map)
Creates a promise from the given map where the values of the map are either closures or Promise instances |
Promise
|
createPromise(Promise... promises)
Creates a promise from one or more other promises |
Promise
|
createPromise(groovy.lang.Closure... c)
Creates a promise from one or many closures |
Promise
|
createPromise(groovy.lang.Closure c, java.util.List decorators)
Creates a promise from one or many closures |
Promise
|
createPromise(java.util.List closures, java.util.List decorators)
Creates a promise from one or many closures |
Promise
|
createPromise(java.util.List closures)
Creates a promise from one or many closures |
Promise
|
onComplete(java.util.List promises, groovy.lang.Closure callable)
Executes the given callback when the list of promises completes |
Promise
|
onError(java.util.List promises, groovy.lang.Closure callable)
Executes the given callback if an error occurs for the list of promises |
java.util.List
|
waitAll(Promise... promises)
Synchronously waits for all promises to complete returning a list of values |
java.util.List
|
waitAll(java.util.List promises)
Synchronously waits for all promises to complete returning a list of values |
java.util.List
|
waitAll(java.util.List promises, long timeout, java.util.concurrent.TimeUnit units)
Synchronously waits for all promises to complete returning a list of values |
Method Detail |
---|
public void addPromiseDecoratorLookupStrategy(PromiseDecoratorLookupStrategy lookupStrategy)
lookupStrategy
- The lookup strategy
public groovy.lang.Closure applyDecorators(groovy.lang.Closure c, java.util.List decorators)
c
- The closuredecorators
- The decorators
public Promise createBoundPromise(java.lang.Object value)
value
- The value
- The type of the value
public Promise createPromise(java.util.Map map)
map
- The map
public Promise createPromise(Promise... promises)
promises
- The promises
public Promise createPromise(groovy.lang.Closure... c)
c
- One or many closures
public Promise createPromise(groovy.lang.Closure c, java.util.List decorators)
c
- One or many closures
public Promise createPromise(java.util.List closures, java.util.List decorators)
closures
- One or many closures
public Promise createPromise(java.util.List closures)
closures
- One or many closures
public Promise onComplete(java.util.List promises, groovy.lang.Closure callable)
promises
- The promisescallable
- The callback to execute
public Promise onError(java.util.List promises, groovy.lang.Closure callable)
promises
- The promises The promisescallable
- The error callback to execute
public java.util.List waitAll(Promise... promises)
promises
- The promises
public java.util.List waitAll(java.util.List promises)
promises
- The promises
public java.util.List waitAll(java.util.List promises, long timeout, java.util.concurrent.TimeUnit units)
promises
- The promises
Groovy Documentation