Paratize v2.1.5 Paratize.Chunk View Source

Implementation of parallel exec via chunks and Task.async / Task.await.

Paratize.Chunk implements the Paratize.Base behaviour and inherits the implementation for parallel_each/3 and parallel_map/3.

Parallelism is achieved within each chunk of functions. Processing on the next chunk starts only after the current chunk is completed.

Link to this section Summary

Functions

Parallel processing of .each function via exec/2. Returns :ok

Parallel processing of functions via chunks. Returns the list of result in order

Parallel processing of .map function via exec/2. Returns list of results in order

Link to this section Types

Link to this section Functions

Link to this function parallel_each(args_list, fun, task_options \\ %Paratize.TaskOptions{}) View Source
parallel_each([arg], (arg -> res), Paratize.TaskOptions.t | Keyword.t) :: :ok

Parallel processing of .each function via exec/2. Returns :ok

Args

  • args_list - list of arguments to be applied to fun
  • fun - function taking in each argument
  • task_options - Paratize.TaskOptions
Link to this function parallel_exec(fun_list, task_options \\ %Paratize.TaskOptions{}) View Source
parallel_exec([(() -> res)], Paratize.TaskOptions.t | Keyword.t) :: [res]

Parallel processing of functions via chunks. Returns the list of result in order.

Args:

iex> [fn -> 1 end, {:b, fn -> 2 end}, fn -> 3 end] |> Paratize.Chunk.parallel_exec [1, {:b,2}, 3]

Link to this function parallel_map(args_list, fun, task_options \\ %Paratize.TaskOptions{}) View Source
parallel_map([arg], (arg -> res), Paratize.TaskOptions.t | Keyword.t) :: [res]

Parallel processing of .map function via exec/2. Returns list of results in order.

Args

  • args_list - list of arguments to be applied to fun
  • fun - function taking in each argument
  • task_options - Paratize.TaskOptions