View Source ProcessHub.Utility.Bag (ProcessHub v0.3.2-alpha)

Utility functions.

Summary

Functions

Returns all messages in the mailbox.

Generates child specs for testing.

Sends hook messages to the given process.

Waits and receives multiple messages.

Generates a hook manager for receiving messages.

Returns the current timestamp in the given precision.

Types

Link to this type

gen_child_specs_opts()

View Source
@type gen_child_specs_opts() :: [prefix: String.t(), id_type: :string | :atom]

Functions

@spec all_messages() :: [term()]

Returns all messages in the mailbox.

Link to this function

gen_child_specs(count, opts \\ [])

View Source
@spec gen_child_specs(integer(), gen_child_specs_opts()) :: list()

Generates child specs for testing.

Link to this function

hook_erlang_send(hook_data, pid, msg)

View Source
@spec hook_erlang_send(
  term(),
  atom() | pid() | port() | reference() | {atom(), node()},
  any()
) :: any()

Sends hook messages to the given process.

Link to this function

receive_multiple(x, receive_key, opts \\ [])

View Source
@spec receive_multiple(pos_integer(), term(), Keyword.t()) :: any()

Waits and receives multiple messages.

Link to this function

recv_hook(key, recv_pid)

View Source
@spec recv_hook(atom(), pid()) :: ProcessHub.Service.HookManager.t()

Generates a hook manager for receiving messages.

Link to this function

timestamp(precision \\ :second)

View Source
@spec timestamp(:microsecond | :millisecond | :nanosecond | :second | pos_integer()) ::
  integer()

Returns the current timestamp in the given precision.