Sea v0.1.0 Sea.Observer behaviour View Source

Defines observer capable of handling signals that will get emitted to it.

Take a look at Sea module for complete Signal + Observer usage examples.

Link to this section Summary

Callbacks

Handle emitted signal

Link to this section Callbacks

Link to this callback handle_signal(struct) View Source
handle_signal(struct()) :: any()

Handle emitted signal.

Example

def handle_signal(%UserRegisteredSignal{user_id: _user_id}) do
  IncrementUserCount.call()
end