View Source EchoPubSub.Producer.Registration (EchoPubSub v0.2.3)
Registers a remote worker before its first batch: {:register, node, missed_writes?}
when the producer has no cursor for it, {:resume, node} when only its worker
restarted.
Runs in a task; finish/5 folds the reply into the producer state.
Summary
Functions
Applies the task's result. On :ok the node is registered and keeps any cursor
it had, so a restarted worker still gets what its old one missed. On :error
it waits for the retry flush with the same start cursor.
Whether pid still needs registering: never registered, or its worker restarted since.
Whether a registration task for node is running (not a failed one waiting to retry).
Starts the registration task for pid on node.
Functions
@spec finish( EchoPubSub.Producer.State.t(), node(), EchoPubSub.Producer.State.cursor(), pid(), :ok | :error ) :: EchoPubSub.Producer.State.t()
Applies the task's result. On :ok the node is registered and keeps any cursor
it had, so a restarted worker still gets what its old one missed. On :error
it waits for the retry flush with the same start cursor.
@spec needed?(EchoPubSub.Producer.State.t(), pid(), node()) :: boolean()
Whether pid still needs registering: never registered, or its worker restarted since.
@spec running?(EchoPubSub.Producer.State.t(), node()) :: boolean()
Whether a registration task for node is running (not a failed one waiting to retry).
@spec start(EchoPubSub.Producer.State.t(), pid(), node()) :: EchoPubSub.Producer.State.t()
Starts the registration task for pid on node.