This method constructs and returns a Future that will eventually hold the result of the execution of the supplied body The execution is performed by the specified Dispatcher.
Construct a completable channel
Create an empty Future with default timeout
Captures a block that will be transformed into 'Continuation Passing Style' using Scala's Delimited Continuations plugin.
Captures a block that will be transformed into 'Continuation Passing Style' using Scala's Delimited Continuations plugin.
Within the block, the result of a Future may be accessed by calling Future.apply. At that point execution is suspended with the rest of the block being stored in a continuation until the result of the Future is available. If an Exception is thrown while processing, it will be contained within the resulting Future.
This allows working with Futures in an imperative style without blocking for each result.
Completing a Future using 'CompletableFuture << Future' will also suspend execution until the value of the other Future is available.
The Delimited Continuations compiler plugin must be enabled in order to use this method.
Simple version of Futures.
Simple version of Futures.traverse. Transforms a Traversable[Future[A]] into a Future[Traversable[A]]. Useful for reducing many Futures into a single Future.
Transforms a Traversable[A] into a Future[Traversable[B]] using the provided Function A => Future[B].
Transforms a Traversable[A] into a Future[Traversable[B]] using the provided Function A => Future[B]. This is useful for performing a parallel map. For example, to apply a function to all items of a list in parallel:
val myFutureList = Futures.traverse(myList)(x => Future(myFunc(x)))