|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectkotka.gradle.utils.Delay
final class Delay
A Delay allows to delay a computation until a later point
in the future. It is a well known concept from more functional oriented
languages. For example in Scheme this construct is called a
promise. This implementation is closely inspired by Clojure's
delay.
| Constructor Summary | |
Delay(groovy.lang.Closure f)
Constructs a new |
|
| Method Summary | |
|---|---|
java.lang.Object
|
doForce()
Forces the computation to happen caching the result. |
static java.lang.Object
|
force(java.lang.Object o)
Forces the delayed compatution. |
| Methods inherited from class java.lang.Object | |
|---|---|
| java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
| Constructor Detail |
|---|
Delay(groovy.lang.Closure f)
Delay which will produce the result
value of the provided Closure f.
f - the closure which captures the computationDelay
| Method Detail |
|---|
java.lang.Object doForce()
Exception
was thrown during the execution of the computation the exception is
rethrown on the current thread.
This is a low-level function. You should use Delay.force
instead.
static java.lang.Object force(java.lang.Object o)
Delay. Should the produced value be another
Delay forcing is continued recursively. Should an exception
be thrown by the delayed computation it is rethrown to be handled by the
calling code.
o - an arbitrary Objecto is a Delay, o itself otherwise
Groovy Documentation