org.positronicnet.notifications
Give a current snapshot of the notifier's state to the handler
Change the query for a NotifierWithQuery.
Cease notifications to a watcher added by AddWatcher
Action to add a watcher that gets notified when the state controlled by the notifier changes.
Action to add a watcher that gets notified when
the state controlled by the notifier changes.
The handler
is called on changes.
If AddWatcher
is sent as notifier ! AddWatcher...
,
the assumption is that the message is being sent from
an Android HandlerThread
(typically, an application's
main "UI thread"), and invocations of the handler
are
posted back to that thread, which makes it safe for a
handler
to manipulate View
objects, and so forth.
The key
is anything that can be used as a hash key;
it is used in a subsequent StopWatcher
call, to
cease notifications.
A combination of AddWatcher
and Fetch
, with the same handler
used for both.
Actions that can be sent to org.positronicnet.notifications.Notifers.
Typical syntax is
notifier ! action
(to have the action performed on a background thread) ornotifier.onThisThread(action)
(to have the action performed on the current thread).Many actions include a
handler
argument, which is a function that takes a notifier update as an argument. If the action is invoked asnotifier ! action
, it's assumed that the caller is on an AndroidHandlerThread
; execution of thehandler
will be posted back to theHandlerThread
. (This means that, in particular, if the caller is an application's main UI thread, it is safe to manipulateView
s from within thehandler
.)