Manifold.Utils (manifold v1.7.0)

Copy Markdown

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

Types

groups()

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

key_fun()

@type key_fun() :: (any() -> any())

Functions

group_by(pids, key_fun)

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

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

hash(key)

@spec hash(atom() | binary() | integer()) :: integer()

next_hibernate_delay()

@spec next_hibernate_delay() :: integer()

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

pack_message(arg1, message)

@spec pack_message(mode :: Manifold.pack_mode(), message :: term()) :: term()

partition_for(pid, partitions)

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

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

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

unpack_message(message)

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