Skip to content

Parallel

Micha Reiser edited this page Dec 13, 2016 · 6 revisions

Parallel

The parallel implementation makes heavy use of the Thread Pool Infrastructure. It is mainly a convenience API that automatically splits the work and joins the sub-results to have a greater benefit of the available computation hardware.

Parallel

IParallel

IParallel is the main facade allowing to create IParallelChain objects. The API is reactive.

IParallelChain

Allows to configure the operations to perform for an IParallelJob in a descriptive way.

parallel
	.range(10)
	.map(i => i * 2)
	.then(result => console.log(result));

Each chained method returns a new IParallelChain instance that represents the operations to perform up to this moment. The result of a chain can be accessed using then, catch or subscribe.

ParallelChainImpl

Implementation of the IParallelChain. Uses an internal IParallelChainState to distinguishes if the chain has not yet been scheduled (PendingParallelChainState), the parallel job is scheduled — maybe even complete — (ScheduledParallelChainState), or if the chain needs to wait for another chain to complete in advance (DependentParallelChainState).

IParallelJobScheduler

IParallelJobScheduler splits the work of an IParallelJob into ITasks of reasonable size and runs them on the IThreadPool.

IParallelJob

The IParallelJob describes a parallel job and all its operations.

Clone this wiki locally