zotonic_notifier (zotonic_notifier v1.0.0-rc.12)
Link to this section Summary
Functions
Unsubscribe an owner from an event
Unsubscribe an owner from an event
Detach all observers owned by the pid
Detach all observers owned by the pid
Return the result of the first observer returning something else than 'undefined'. Return 'undefined' if none.
Return the result of the first observer returning something else than 'undefined'. Return 'undefined' if none.
Return the list of all observers for a specific event
Call all observers, return a list of all return values.
Notify the first observer. Pids async, M:F sync.
Notify the first observer. Pids async, M:F sync.
Notify observers async. Start separate process for the notification.
Notify observers async. Start separate process for the notification.
Notify observers. Pids async, M:F sync.
Notify observers. Pids async, M:F sync.
Register an observer pid.
Register an observer with an owner pid.
Register an observer with the default notifier. Higher prio (lower nr) gets called earlier.
Register an observer. Higher prio (lower nr) gets called earlier.
Link to this section Types
Link to this type
event/0
-type event() :: term().
Link to this type
notifier/0
-type notifier() :: atom() | pid().
Link to this type
observer/0
-type observer() :: pid() | {module(), atom()} | {module(), atom(), list()}.
Link to this section Functions
Link to this function
await(Event)
-spec await(atom() | tuple()) ->
{ok, tuple() | atom()} | {ok, {pid(), reference()}, tuple() | atom()} | {error, timeout}.
Link to this function
await(Event, Msg)
-spec await(term(), atom() | tuple()) ->
{ok, tuple() | atom()} | {ok, {pid(), reference()}, tuple() | atom()} | {error, timeout}.
Link to this function
await(Event, Msg, Timeout)
-spec await(term(), atom() | tuple(), pos_integer()) ->
{ok, tuple() | atom()} | {ok, {pid(), reference()}, tuple() | atom()} | {error, timeout}.
Link to this function
await(Notifier, Event, Msg, Timeout)
-spec await(notifier(), term(), atom() | tuple(), pos_integer()) -> {ok, tuple() | atom()} | {ok, {pid(), reference()}, tuple() | atom()} | {error, timeout}.
Link to this function
await_exact(Event, Msg)
-spec await_exact(event(), term()) -> {ok, term()} | {ok, {pid(), reference()}, term()} | {error, timeout}.
Link to this function
await_exact(Event, Msg, Timeout)
-spec await_exact(event(), term(), pos_integer()) -> {ok, term()} | {ok, {pid(), reference()}, term()} | {error, timeout}.
Link to this function
await_exact(Notifier, Event, Msg, Timeout)
Link to this function
detach(Event, OwnerPid)
-spec detach(event(), pid()) -> ok | {error, term()}.
Link to this function
detach(Notifier, Event, OwnerPid)
Link to this function
detach_all(OwnerPid)
-spec detach_all(pid()) -> ok.
Link to this function
detach_all(Notifier, OwnerPid)
-spec detach_all(notifier(), pid()) -> ok.
Link to this function
first(Event, Msg, ContextArg)
-spec first(event(), term(), term()) -> term() | undefined.
Link to this function
first(Notifier, Event, Msg, ContextArg)
Link to this function
foldl(Event, Msg, Value, ContextArg)
-spec foldl(event(), term(), term(), term()) -> term().
Link to this function
foldl(Notifier, Event, Msg, Value, ContextArg)
Link to this function
foldr(Event, Msg, Value, ContextArg)
-spec foldr(event(), term(), term(), term()) -> term().
Link to this function
foldr(Notifier, Event, Msg, Value, ContextArg)
Link to this function
get_observers(Event)
-spec get_observers(event()) -> list().
Link to this function
get_observers(Notifier, Event)
Link to this function
map(Event, Msg, ContextArg)
-spec map(event(), term(), term()) -> [term()].
Link to this function
map(Notifier, Event, Msg, ContextArg)
Link to this function
notify1(Event, Msg, ContextArg)
-spec notify1(event(), term(), term()) -> ok | {error, term()}.
Link to this function
notify1(Notifier, Event, Msg, ContextArg)
Link to this function
notify(Event, Msg, ContextArg)
-spec notify(event(), term(), term()) -> ok | {error, term()}.
Link to this function
notify(Notifier, Event, Msg, ContextArg)
Link to this function
notify_sync(Event, Msg, ContextArg)
-spec notify_sync(event(), term(), term()) -> ok | {error, term()}.
Link to this function
notify_sync(Notifier, Event, Msg, ContextArg)
Link to this function
observe(Event, ObserverPid)
-spec observe(event(), pid()) -> ok | {error, term()}.
Link to this function
observe(Event, Observer, OwnerPid)
Link to this function
observe(Event, Observer, OwnerPid, Prio)
Link to this function
observe(Notifier, Event, Observer, OwnerPid, Prio)
Link to this function
start()
Link to this function
start(StartType, StartArgs)
Link to this function
start_notifier(Name)
-spec start_notifier(atom()) -> {ok, pid()} | {error, term()}.
Link to this function
stop(State)
Link to this function
stop_notifier(Name)
-spec stop_notifier(atom()) -> ok.