Watch
const abstract class Watch : Obj
Watch is a subscription to a set of records in a project database. It provides an efficient mechanism to poll for changes. Also see Watches.
The lease determines the max duration which may elapse without a renew call before the watch is expired
Convenience for addAll([id])
Debug string
Runtime associated with this watch
Convenience for addAll for id column of each row
Return if the list of recs currently subscribed is empty
Get all the records which have been modified since the given ticks
List the rec ids currently subscribed by this watch
Convenience for removeAll([id])
Debug display string used during watchOpen
Remove the given records from this watch
Return if this watch has been closed
Add the given records to this watch
Equality based on reference equality
Identifier which uniquely identifies this watch in the project
Close this watch and unsubscribe all its records
Identity hash
Convenience for removeAll for id column of each row
Void add(Ref id)
Convenience for addAll([id])
abstract Void addAll(Ref[] ids)
Add the given records to this watch. Silently ignore any ids already subscribed by this watch, not found in the database, or which are inaccessible to the current user. Raise exception if watch is closed. This call renews the lease.
Void addGrid(Grid grid)
Convenience for addAll for id column of each row. If any row is missing an id tag then it is silently skipped.
abstract Void close()
Close this watch and unsubscribe all its records. If watch is already closed, this method is a no op.
abstract Str dis()
Debug display string used during watchOpen
Bool equals(Obj? that)
Equality based on reference equality
Int hash()
Identity hash
abstract Str id()
Identifier which uniquely identifies this watch in the project
abstract Bool isClosed()
Return if this watch has been closed
abstract Bool isEmpty()
Return if the list of recs currently subscribed is empty.
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.
abstract Ref[] list()
List the rec ids currently subscribed by this watch. Raise exception if watch is closed.
abstract Dict[] poll(Duration ticks)
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.
Void remove(Ref id)
Convenience for removeAll([id])
abstract Void removeAll(Ref[] ids)
Remove the given records from this watch. Any ids not currently subscribed by this watch are silently ignored. Raise exception if watch is closed. This call renews the lease.
Void removeGrid(Grid grid)
Convenience for removeAll for id column of each row
abstract Runtime rt()
Runtime associated with this watch
Str toStr()
Debug string