PelemayFp.ParallelSplitter (PelemayFp v0.1.2) View Source

Provides the split function that divides a given enumerable into a chunk list whose size equals to or is less than the given threshold, with spawing each process corresponding to the chunk list, and the range function that returns the range from the number of the chunk minus 1 to 0.

Link to this section Summary

Functions

Returns the range from the number of the chunk minus 1 to 0.

Returns a reversed list of tuples of a process or tuple of a process and a reference, and identity of the process that spawns the given function fun from module mod, passing pid, a list containing threshold elements each, id of the list and arg, according to the given options.

Link to this section Types

Link to this section Functions

Link to this function

range(collection, threshold)

View Source

Specs

range(Enum.t(), pos_integer()) :: Range.t()

Returns the range from the number of the chunk minus 1 to 0.

Link to this function

split(arg, pid, id, enumerable, threshold, arg, opts)

View Source

Specs

split(
  {module(), atom()},
  pid(),
  non_neg_integer(),
  Enum.t(),
  pos_integer(),
  any(),
  Process.spawn_opts()
) :: t()

Returns a reversed list of tuples of a process or tuple of a process and a reference, and identity of the process that spawns the given function fun from module mod, passing pid, a list containing threshold elements each, id of the list and arg, according to the given options.

The result depends on the given options. In particular, if :monitor is given as an option, it will return list of tuples containing the PID and the monitoring reference, otherwise just the spawned process PID.

It also accepts extra options, for the list of available options check :erlang.spawn_opt/4.