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 'Promise << 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.
(Since version 2.3) dataflow is deprecated, superseded by Scala Async