diff --git a/CONCURRENCY.md b/CONCURRENCY.md index 660aba483dd..faa852ec773 100644 --- a/CONCURRENCY.md +++ b/CONCURRENCY.md @@ -27,20 +27,20 @@
```kotlin - val future = execute(TransferMode.SAFE, { SomeDataForWorker() }) { - // data returned by the second function argument comes to the - // worker routine as 'input' parameter. - input -> - // Here we create an instance to be returned when someone consumes result future. - WorkerResult(input.stringParam + " result") - } +val future = execute(TransferMode.SAFE, { SomeDataForWorker() }) { + // data returned by the second function argument comes to the + // worker routine as 'input' parameter. + input -> + // Here we create an instance to be returned when someone consumes result future. + WorkerResult(input.stringParam + " result") +} - future.consume { - // Here we see result returned from routine above. Note that future object or - // id could be transferred to another worker, so we don't have to consume future - // in same execution context it was obtained. - result -> println("result is $result") - } +future.consume { + // Here we see result returned from routine above. Note that future object or + // id could be transferred to another worker, so we don't have to consume future + // in same execution context it was obtained. + result -> println("result is $result") +} ```