Package net.corda.core.concurrent
Class ConcurrencyUtilsKt
-
- All Implemented Interfaces:
public final class ConcurrencyUtilsKt
-
-
Method Summary
Modifier and Type Method Description final static <V extends Any, W extends Any> W
match(Future<V> $self, Function1<V, W> success, Function1<Throwable, W> failure)
Invoke getOrThrow and pass the value/throwable to success/failure respectively. final static <V extends Any, W extends Any> CordaFuture<W>
firstOf(CordaFuture<out V> futures, Function1<CordaFuture<out V>, W> handler)
As soon as a given future becomes done, the handler is invoked with that future as its argument. -
-
Method Detail
-
match
final static <V extends Any, W extends Any> W match(Future<V> $self, Function1<V, W> success, Function1<Throwable, W> failure)
Invoke getOrThrow and pass the value/throwable to success/failure respectively.
-
firstOf
final static <V extends Any, W extends Any> CordaFuture<W> firstOf(CordaFuture<out V> futures, Function1<CordaFuture<out V>, W> handler)
As soon as a given future becomes done, the handler is invoked with that future as its argument. The result of the handler is copied into the result future, and the handler isn't invoked again. If a given future errors after the result future is done, the error is automatically logged.
-
-
-
-