View Source ProcessHub.Utility.Bag (ProcessHub v0.2.0-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.

Returns the current timestamp in the given precision.

Functions

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

Returns all messages in the mailbox.

Link to this function

gen_child_specs(count, prefix \\ "child")

View Source
@spec gen_child_specs(integer(), any()) :: 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

timestamp(precision \\ :second)

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

Returns the current timestamp in the given precision.