Copyright © 2009-2017 Marc Worrell
Authors: Marc Worrell (marc@worrell.nl).
await/2 | Subscribe once to a notification, detach after receiving the notification. |
await/3 | |
await_exact/2 | |
await_exact/3 | |
detach/2 | Unsubscribe from an event. |
detach/3 | |
detach_all/1 | Detach all observers and delete the event. |
detach_all/2 | |
first/2 | Call all observers till one returns something else than undefined. |
foldl/3 | Do a fold over all observers, prio 1 observers first. |
foldr/3 | Do a fold over all observers, prio 1 observers last. |
get_observers/1 | List all observers for all events for the site. |
get_observers/2 | Return all observers for a particular event. |
map/2 | Call all observers, return the list of answers. |
notify/2 | Async cast the event to all observers. |
notify1/2 | Async cast the event to the first observer. |
notify_queue/1 | Notify delayed notifications. |
notify_queue_flush/1 | Erase queued notifications. |
notify_sync/2 | Sync cast the event to all observers. |
observe/3 | Subscribe to an event. |
observe/4 | Subscribe to an event. |
observe/5 |
await(Msg::tuple() | atom(), Context::z:context()) -> {ok, tuple() | atom()} | {ok, {pid(), reference()}, tuple() | atom()} | {error, timeout}
Subscribe once to a notification, detach after receiving the notification.
await(Msg::tuple() | atom(), Timeout::pos_integer(), Context::z:context()) -> {ok, tuple() | atom()} | {ok, {pid(), reference()}, tuple() | atom()} | {error, timeout}
await_exact(Msg::tuple() | atom(), Context::#context{}) -> {ok, tuple() | atom()} | {ok, {pid(), reference()}, tuple() | atom()} | {error, timeout}
await_exact(Msg::tuple() | atom(), Timeout::pos_integer(), Context::z:context()) -> {ok, tuple() | atom()} | {ok, {pid(), reference()}, tuple() | atom()} | {error, timeout}
detach(Event, Context) -> any()
Unsubscribe from an event.
detach(Event, OwnerPid, Site) -> any()
detach_all(Context) -> any()
Detach all observers and delete the event
detach_all(OwnerPid, Site) -> any()
first(Msg, Context) -> any()
Call all observers till one returns something else than undefined. The prototype of the observer is: f(Msg, Context)
foldl(Msg, Acc0, Context) -> any()
Do a fold over all observers, prio 1 observers first. The prototype of the observer is: f(Msg, Acc, Context)
foldr(Msg, Acc0, Context) -> any()
Do a fold over all observers, prio 1 observers last
get_observers(Context::z:context()) -> [{atom(), [{integer(), zotonic_notifier:observer()}]}]
List all observers for all events for the site.
get_observers(Event, Site) -> any()
Return all observers for a particular event
map(Msg, Context) -> any()
Call all observers, return the list of answers. The prototype of the observer is: f(Msg, Context)
notify(Msg, Context) -> any()
Async cast the event to all observers. The prototype of the observer is: f(Msg, Context) -> void
notify1(Msg, Context) -> any()
Async cast the event to the first observer. The prototype of the observer is: f(Msg, Context) -> void
notify_queue(Context) -> any()
Notify delayed notifications.
notify_queue_flush(Context) -> any()
Erase queued notifications
notify_sync(Msg, Context) -> any()
Sync cast the event to all observers. The prototype of the observer is: f(Msg, Context) -> void
observe(Event, Observer, Context) -> any()
Subscribe to an event. Observer is a MFA or pid()
observe(Event, Observer, Priority, Context) -> any()
Subscribe to an event. Observer is a MFA or pid()
observe(Event::zotonic_notifier:event(), Observer::zotonic_notifier:observer(), OwnerPid::pid(), Priority::integer(), Site::atom() | z:context()) -> ok | {error, term()}
Generated by EDoc