- Loading...
...
| Code Block | ||
|---|---|---|
| ||
try (var scope = FiberScope.cancellable()) {
var queue = new FiberScope.TerminationQueue<String>();
Arrays.stream(tasks).forEach(task -> scope.schedule(task, queue));
IntStream.range(0, tasks.length)
.mapToObj(x -> queue.takeUninterruptibly())
.map(Fiber::join)
.forEach(System.out::println);
} |
There is no support yet for making context available to all fibers scheduled in the scope. InheritedThreadLocals can be used in the mean-time.