View Source EchoPubSub.Producer.Remote (EchoPubSub v0.2.2)

Calls the producer's tasks make to remote workers. Every failure (timeout, dead worker, nodedown, injected fault, non-:ok reply) becomes an error result, so a task never crashes.

Summary

Functions

Sends a batch, or {:expired, node()} for a node too far behind, and returns the verdict the producer folds into its state.

Pings the worker to learn whether it answers again. A worker older than :ping replies {:error, :bad_message}, which still proves it is alive.

Sends {:register, node, missed_writes?} or {:resume, node} to the worker.

Types

@type batch() :: {:expired, pos_integer()} | {:messages, [term()]}
@type registration() :: {:register, node(), boolean()} | {:resume, node()}
@type verdict() ::
  :ok | {:expired, pos_integer()} | :expired_failed | {:failed, pos_integer()}

Functions

Link to this function

deliver(pid, arg, timeout)

View Source
@spec deliver(pid(), batch(), timeout()) :: verdict()

Sends a batch, or {:expired, node()} for a node too far behind, and returns the verdict the producer folds into its state.

@spec probe(pid(), timeout()) :: :ok | :error

Pings the worker to learn whether it answers again. A worker older than :ping replies {:error, :bad_message}, which still proves it is alive.

Link to this function

register(pid, message, timeout)

View Source
@spec register(pid(), registration(), timeout()) :: :ok | :error

Sends {:register, node, missed_writes?} or {:resume, node} to the worker.