class com.dongxiguo.continuation.utils.ForkJoin

Available on all platforms

Class Fields

static function fork(handler:Bool ->Void):Void

Forks the current thread.

Usage:

if (@await ForkJoin.fork())
    {
      // Forked thread #1
    }
    else
    {
      // Forked thread #2
    }

static function hang(handler:Dynamic):Void

Hangs up the current thread.

Usage: return @await ForkJoin.hang();

static function startCollectors<Identifier, Result>(collectorIdentifiers:Iterable<Identifier>, handler:Identifier ->CollectFunction<Result> ->Void):Void

Like ForkJoin.startThreads, but returns a CollectFunction instead of JoinFunction.

static function startThreads<Identifier>(threadIdentifiers:Iterable<Identifier>, handler:Identifier ->JoinFunction ->Void):Void

Forks threads for every element in threadIdentifiers. @param handler The callback function invoked for each element in threadIdentifiers. The handler can receive two parameters: the element in threadIdentifiers and the JoinFunction.