Manifold.Utils (manifold v1.6.0)

Link to this section Summary

Functions

A faster version of Enum.group_by with less bells and whistles.

Gets the next delay at which we should attempt to hibernate a worker or partitioner process.

Computes the partition for a given pid using :erlang.phash2/2

Partitions a bunch of pids into a tuple, of lists of pids grouped by by the result of :erlang.pash2/2

Link to this section Types

@type groups() :: %{required(any()) => [pid()]}
@type key_fun() :: (any() -> any())

Link to this section Functions

Link to this function

group_by(pids, key_fun)

@spec group_by([pid()], key_fun()) :: groups()

A faster version of Enum.group_by with less bells and whistles.

@spec hash(atom() | binary() | integer()) :: integer()
Link to this function

next_hibernate_delay()

@spec next_hibernate_delay() :: integer()

Gets the next delay at which we should attempt to hibernate a worker or partitioner process.

Link to this function

pack_message(arg1, message)

@spec pack_message(mode :: Manifold.pack_mode(), message :: term()) :: term()
Link to this function

partition_for(pid, partitions)

@spec partition_for(pid(), integer()) :: integer()

Computes the partition for a given pid using :erlang.phash2/2

Link to this function

partition_pids(pids, partitions)

@spec partition_pids([pid()], integer()) :: tuple()

Partitions a bunch of pids into a tuple, of lists of pids grouped by by the result of :erlang.pash2/2

Link to this function

unpack_message(message)

@spec unpack_message(message :: term()) :: term()