Runtime
const mixin Runtime
Runtime manages a database, library namespace, and extensions. It is the base type for both Sys and Proj. In the Haxall daemon there is one runtime that is both the Sys and Proj. But in SkySpark there is one host level Sys for the VM and zero more separate Proj runtimes.
Convenience for commitAll to commit a single diff
Apply a list of diffs to the database in batch
Folio database for this runtime
Runtime file directory
Display name of the runtime
Convenience for exts.get to lookup extension by lib dotted name
Extension lookup and management
Runtime id which is always formatted as "p:{name}"
Return if this runtime is a project
Running flag
Has the runtime has reached steady state
Return if this runtime is the system
Xeto library management
Log for runtime level logging
Runtime level meta data stored in the rt:meta database record
Programatic name of the runtime
Construct new context with user
Xeto lib namespace for this runtime
Observables
Find the first record which matches the given filter string
Match all the records against a filter string and return as grid
Match all the records against a filter string and return as list
Read record by id
Read a list of records by ids into a grid
Read a list of records by id
Return the number of records which match the given filter string
Block until currently queued background processing completes
Reference to system runtime
Watch subscriptions
abstract Diff commit(Diff diff)
Convenience for commitAll to commit a single diff.
abstract Diff[] commitAll(Diff[] diffs)
Apply a list of diffs to the database in batch. Either all the changes are successfully applied, or else none of them are applied and an exception is raised. Return updated Diffs which encapsulate both the old and new version of each record.
If any of the records have been modified since they were read
for the given change set then ConcurrentChangeErr is thrown
unless Diff.force configured.
abstract Folio db()
Folio database for this runtime
abstract File dir()
Runtime file directory. It the root directory of all runtime oriented
operational files. The folio database is stored under this directory
in a sub-directory named db/, and namespace support in ns/
abstract Str dis()
Display name of the runtime.
abstract Ext? ext(Str name, Bool checked := true)
Convenience for exts.get to lookup extension by lib dotted name
abstract RuntimeExts exts()
Extension lookup and management
abstract Ref id()
Runtime id which is always formatted as "p:{name}"
abstract Bool isProj()
Return if this runtime is a project
abstract Bool isRunning()
Running flag. On startup this flag transitions to true before calling ready and start on all the extensions. On shutdown this flag transitions to false before calling unready and stop on all the libraries.
abstract Bool isSteadyState()
Has the runtime has reached steady state. Steady state is reached after a configurable wait period elapses after the runtime is fully loaded. This gives internal services time to spin up before interacting with external systems. See Runtime.
abstract Bool isSys()
Return if this runtime is the system
abstract RuntimeLibs libs()
Xeto library management
abstract Log log()
Log for runtime level logging
abstract RuntimeMeta meta()
Runtime level meta data stored in the rt:meta database record.
This dict always includes a synthetic name tag
abstract Str name()
Programatic name of the runtime. This string is always a valid tag name.
virtual Context newContext(User user)
Construct new context with user
abstract Namespace ns()
Xeto lib namespace for this runtime
abstract RuntimeObservables obs()
Observables
abstract Dict? read(Str filter, Bool checked := true)
Find the first record which matches the given filter string. If checked is true, throw UnknownRecErr if none found. Or if checked is false return null. Recs missing read permission in current context are silently excluded from the match; a PermissionErr is never thrown. See Filter Chapter for filter format.
abstract Grid readAll(Str filter, Dict? opts := null)
Match all the records against a filter string and return as grid. Recs missing read permission in current context are silently excluded; a PermissionErr is never thrown. See Filter Chapter for filter format.
abstract Dict[] readAllList(Str filter, Dict? opts := null)
Match all the records against a filter string and return as list. This method uses the same security semantics as readAll. See Filter Chapter for filter format and readAll to return results as a grid.
abstract Dict? readById(Ref? id, Bool checked := true)
Read record by id. A null id is treated the same as an unknown record. If checked is true, throw UnknownRecErr if not found, or throw PermissionErr if missing read permission in current context. Or if checked is false return null in those cases.
abstract Grid readByIds(Ref[] ids, Bool checked := true)
Read a list of records by ids into a grid. The rows in the result
correspond by index to the ids list. If checked is true, throw
UnknownRecErr if any id is not found, or throw
PermissionErr if missing read permission in current context.
Or if checked is false return a row with every column set to null
(including the id tag) in those cases.
abstract Dict?[] readByIdsList(Ref[] ids, Bool checked := true)
Read a list of records by id. The resulting list matches the list of ids by index. If checked is true, throw UnknownRecErr if any id is not found, or throw PermissionErr if missing read permission in current context. Or if checked is false return null for those items.
abstract Int readCount(Str filter)
Return the number of records which match the given filter string. Recs missing read permission in current context are silently excluded; a PermissionErr is never thrown. See Filter Chapter for filter format.
abstract This sync(Duration? timeout := 30sec)
Block until currently queued background processing completes
abstract Sys sys()
Reference to system runtime
abstract RuntimeWatches watch()
Watch subscriptions