Cairn.Message (cairn v0.1.1)

Copy Markdown View Source

A small message envelope with sender, payload, and correlation ref.

Summary

Functions

Builds a reply that preserves the original ref.

Types

from()

@type from() :: pid() | atom()

payload()

@type payload() :: term()

ref()

@type ref() :: term()

t()

@type t() :: %Cairn.Message{from: from(), payload: payload(), ref: ref()}

Functions

new(from, payload, ref \\ make_ref())

@spec new(from(), payload(), ref()) :: t()

Builds a message.

reply(message, payload)

@spec reply(t(), payload()) :: t()

Builds a reply that preserves the original ref.