WardrikEvents.Subscribers (wardrik_events v0.1.0-rc.1)

Copy Markdown

Sends each event, as it's written, to the processes subscribed to its log.

Summary

Functions

Sends event to every process subscribed to log, as {WardrikEvents, log, event}.

Subscribes the calling process to the logs resources match.

Unsubscribes the calling process from resources.

Functions

publish(group, log, event)

@spec publish(atom(), String.t(), map()) :: :ok

Sends event to every process subscribed to log, as {WardrikEvents, log, event}.

subscribe(group, resources)

@spec subscribe(atom(), [String.t()]) :: :ok

Subscribes the calling process to the logs resources match.

unsubscribe(group, resources)

@spec unsubscribe(atom(), [String.t()]) :: :ok

Unsubscribes the calling process from resources.