firstOf - corda

corda / net.corda.core.concurrent / firstOf

# firstOf

`fun <V, W> firstOf(vararg futures: CordaFuture<out V>, handler: (CordaFuture<out V>) -> W): CordaFuture<W>`

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.