Paratize v2.1.1 Paratize.Pool

Implementation of parallel exec via pool of spawned workers processes.

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

True parallelism for the entire workload of functions, in which workers will fetch jobs from the fun_list until empty.

Summary

Functions

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

parallel_exec/3 with default task_options

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

parallel_map/3 with default task_options

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

Functions

parallel_each(args_list, fun)

parallel_each/3 with default task_options.

parallel_each(args_list, fun, task_options)

Specs

parallel_each(List.t, Fun, 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
parallel_exec(fun_list)

parallel_exec/3 with default task_options.

parallel_exec(fun_list, task_options)

Specs

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

Args:

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

parallel_map(args_list, fun)

parallel_map/3 with default task_options.

parallel_map(args_list, fun, task_options)

Specs

parallel_map(List.t, Fun, Paratize.TaskOptions.t | Keyword.t) :: List.t

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