Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
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);
}

FiberScope Variables/Locals

There is no support yet for making context available to all fibers scheduled in the scope. InheritedThreadLocals can be used in the mean-time.

Issues/API/TBD