type
HxWatch
abstract const class HxWatch : Obj
HxWatch is a subscription to a set of records in a project database. It provides an efficient mechanism to poll for changes. Also see Watches.
fields
lease |
The lease determines the max duration which may elapse without a renew call before the watch is expired. |
---|
methods
add |
Convenience for |
---|---|
addAll |
Add the given records to this watch. |
addGrid |
Convenience for |
close |
Close this watch and unsubscribe all its records. |
dis |
Debug display string used during |
equals |
Equality based on reference equality |
hash |
Identity hash |
id |
Identifier which uniquely identifies this watch in the project |
isClosed |
Return if this watch has been closed |
isEmpty |
Return if the list of recs currently subscribed is empty. |
list |
List the rec ids currently subscribed by this watch. |
poll |
Get all the records which have been modified since the given ticks. |
remove |
Convenience for |
removeAll |
Remove the given records from this watch. |
removeGrid |
Convenience for |
rt |
Runtime associated with this watch |
toStr |
Debug string |
Slot Details
add
addAll
addGrid
close
abstract Void close()
Close this watch and unsubscribe all its records. If watch is already closed, this method is a no op.
dis
abstract Str dis()
Debug display string used during watchOpen
equals
hash
override Int hash()
Identity hash
id
abstract Str id()
Identifier which uniquely identifies this watch in the project
isClosed
abstract Bool isClosed()
Return if this watch has been closed
isEmpty
abstract Bool isEmpty()
Return if the list of recs currently subscribed is empty.
lease
abstract Duration lease
The lease determines the max duration which may elapse without a renew call before the watch is expired. The default is 1min. Clients can attempt to tune the lease time by setting this field, but no guarantee is made that the framework will honor extremely long lease times.
list
abstract Ref[] list()
List the rec ids currently subscribed by this watch. Raise exception if watch is closed.
poll
abstract Dict[] poll(Duration ticks := this.lastPoll())
Get all the records which have been modified since the given ticks. An empty list is returned if no changes have been made to the watched records since ticks. There is no ordering to the resulting list. This method automatically renews the lease and keeps track of the last poll ticks. Also see Watches.
remove
removeAll
removeGrid
rt
abstract HxRuntime rt()
Runtime associated with this watch
toStr
override Str toStr()
Debug string