parallax v1.0.0 Parallax
Simple module for orchestrating parallel tasks.
There are two basic abstractions for a Parallax operation, a Parallax.Graph.t
,
created by new/0
, or a Parallax.Sequence.t
, created by sequence/0
. The latter
allows you to tweak your own parallelism structure, while the graph infers an optimal
parallelism strategy from the dependency DAG defined by subsequent calls to operation/4
.
There are three main ways to add to sequences:
sync/3
- appends a task to be executed synchronouslyparallel/3
- adds the task to be executed in parallel within the current batchnest/3
- nests an existing Parallax.Executable within the current batch
To add to a graph, simply do Parallax.sync(graph, :name, fun, requires: :requirement)
(also
accepting a list of requirements)
To execute the operation, simply call Parallax.execute/1
All require a unique name so the result can be addressed after execution
Link to this section Summary
Functions
Nests another executable within the current batch. This is really just an alias to parallel, but distinct naming is there for clarity
Creates a new sequence with the given opts to pass along
Adds the operation to the current batch for parallelization
Appends a new batch to the sequence, and adds the given operation to it. Sequence ops are inherited
Link to this section Types
executable() :: Parallax.Batch.t() | Parallax.Sequence.t() | (map() -> any())
Link to this section Functions
Nests another executable within the current batch. This is really just an alias to parallel, but distinct naming is there for clarity.
Creates a new sequence with the given opts to pass along
Adds the operation to the current batch for parallelization.
Appends a new batch to the sequence, and adds the given operation to it. Sequence ops are inherited.