type

HxLib

abstract const class HxLib : Obj

Base class for all Haxall library runtime instances. All Haxall libs must be standard Haystack 4 libs. This class is used to model the instance of the library within a HxRuntime to provide runtime services.

To create a new library:

  1. Create a pod with a standard Haystack 4 "lib/lib.trio" definition
  2. Register the lib name using the indexed prop "ph.lib"
  3. Create subclass of HxLib
  4. Ensure your lib definition has typeName tag for subclass qname

Also see Libs.

constructors

make

Framework use only.

methods

equals

Equality is based on reference equality

hash

Identity hash

houseKeepingFreq

Override to return non-null for onHouseKeeping callback

isRunning

Running flag.

log

Logger to use for this library

name

Programmatic name of the library

observables

Return list of observables this extension publishes.

observe

Subscribe this library to an observable.

onHouseKeeping

Callback made periodically to perform background tasks.

onReady

Callback when all libs are fully started.

onRecUpdate

Callback when associated database rec is modified.

onStart

Callback when library is started.

onSteadyState

Callback when runtime reaches steady state.

onStop

Callback when library is stopped.

onUnready

Callback before we stop the runtime This is called on dedicated background actor.

rec

Database record which enables this library and stores settings.

rt

Runtime

services

Return list of services this library publishes.

subscriptions

Observable subscriptions for this extension

toStr

Return name

web

Web service handling for this library

Slot Details

equals

override Bool equals(Obj? that)

Equality is based on reference equality

hash

override Int hash()

Identity hash

houseKeepingFreq

virtual Duration? houseKeepingFreq()

Override to return non-null for onHouseKeeping callback

isRunning

Bool isRunning()

Running flag. On startup this flag transitions to true before calling ready and start on the library. On shutdown this flag transitions to false before calling unready and stop on the library.

log

Log log()

Logger to use for this library

make

new make()

Framework use only. Subclasses must declare public no-arg constructor.

name

Str name()

Programmatic name of the library

observables

virtual Observable[] observables()

Return list of observables this extension publishes. This method must be overridden as a const field and set in the constructor.

observe

Subscription observe(Str name, Dict config, Obj callback)

Subscribe this library to an observable. The callback must be an Actor instance or Method literal on this class. If callback is a method, then its called on the lib's dedicated background actor. pool. This method should be called in the onStart callback. The observation is automatically unsubscribed on stop. You should not unsubscribe this subscription - it must be managed by the extension itself. See Observables.

onHouseKeeping

virtual Void onHouseKeeping()

Callback made periodically to perform background tasks. Override houseKeepingFreq to enable the frequency of this callback.

onReady

virtual Void onReady()

Callback when all libs are fully started. This is called on dedicated background actor.

onRecUpdate

virtual Void onRecUpdate()

Callback when associated database rec is modified. This is called on dedicated background actor.

onStart

virtual Void onStart()

Callback when library is started. This is called on dedicated background actor.

onSteadyState

virtual Void onSteadyState()

Callback when runtime reaches steady state. This is called on dedicated background actor.

onStop

virtual Void onStop()

Callback when library is stopped. This is called on dedicated background actor.

onUnready

virtual Void onUnready()

Callback before we stop the runtime This is called on dedicated background actor.

rec

virtual Dict rec()

Database record which enables this library and stores settings. This field may be overridden with a TypedDict subclass. Also see Libs.

rt

virtual HxRuntime rt()

Runtime

services

virtual HxService[] services()

Return list of services this library publishes. This callback is made during initialization and each time a lib is added/removed from the runtime.

subscriptions

Subscription[] subscriptions()

Observable subscriptions for this extension

toStr

override Str toStr()

Return name

web

virtual HxLibWeb web()

Web service handling for this library