ObserverEngine class final

The all_observer preset of the public ReactiveEngine (engine v2, Fase 2): the concrete engine instance plus the node types that bridge the engine graph to the package's registry-based world.

Three node kinds participate:

  • RegistrySignalNode — the engine identity of a ListenerRegistry (a plain CoreObservable, a reactive collection, anything that notifies through a registry). Created lazily on first tracked read.
  • ComputedEngineNode — the engine identity of a CoreComputed. Its update/unwatched behavior is delegated back to the owning CoreComputed through callbacks, so equals filtering and inspector events stay where they always lived.
  • WatcherNode — an effect-like node owned by a CoreComputed that has external listeners; it is what turns lazy engine marking into the package's eager listener notification, by scheduling a pull through BatchScope.queueDirtyFlush (wired via callback to avoid an import cycle).

O preset all_observer do ReactiveEngine público (motor v2, Fase 2): a instância concreta do motor mais os tipos de nó que fazem a ponte entre o grafo do motor e o mundo baseado em registries do pacote.

Três tipos de nó participam:

  • RegistrySignalNode — a identidade no motor de um ListenerRegistry (um CoreObservable comum, uma coleção reativa, qualquer coisa que notifique por um registry). Criado preguiçosamente na primeira leitura rastreada.
  • ComputedEngineNode — a identidade no motor de um CoreComputed. Seu comportamento de update/unwatched é delegado de volta ao CoreComputed dono através de callbacks, então o filtro equals e os eventos de inspector continuam onde sempre viveram.
  • WatcherNode — um nó tipo effect, de posse de um CoreComputed com listeners externos; é o que converte a marcação preguiçosa do motor na notificação ansiosa de listeners do pacote, agendando um pull via BatchScope.queueDirtyFlush (ligado por callback para evitar ciclo de import).
Inheritance

Properties

activeSub ReactiveNode?
The node currently (re)computing, if any — reads reaching DependencyTracker.reportRead while this is non-null are linked as engine dependencies of it.
getter/setter pair
cycle int
Monotonic tracking-cycle counter (see ReactiveEngine.link).
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

checkDirty(ReactiveLink link, ReactiveNode sub) bool
Pull phase: walks sub's dependencies starting at link and confirms whether anything upstream actually changed, calling update on stale mutable dependencies along the way (deepest first, iteratively). Returns true if sub must recompute. This is what makes pending cheap: a maybe-stale node only does real work when someone pulls it.
inherited
Whether checkLink is currently an edge of sub's dependency list. Used by propagate to validate self-dependency scenarios.
inherited
Records that sub depends on dep in tracking cycle version.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notify(ReactiveNode node) → void
Called during propagate for nodes flagged ReactiveFlags.watching. Implementations typically queue the node for execution after the current write/batch completes.
override
propagate(ReactiveLink link, [bool innerWrite = false]) → void
Push phase: starting from link (the subscriber list of a node that just changed), walks the graph iteratively marking subscribers pending (or dirty via shallowPropagate later) and calling notify on watching nodes. Recursion through mutable nodes is flattened with an explicit EngineStack. innerWrite must be true when the write happened inside a running effect, enabling the re-entrancy bookkeeping (ReactiveFlags.recursed).
inherited
shallowPropagate(ReactiveLink link) → void
Promotes pending subscribers of a node that confirmed a change to dirty, notifying watchers. Non-recursive: touches immediate subscribers only.
inherited
toString() String
A string representation of this object.
inherited
Removes the edge link from both lists it belongs to. If the dependency side loses its last subscriber, unwatched fires. Returns the next link in sub's dependency list (an iteration convenience).
inherited
unwatched(ReactiveNode node) → void
Called by unlink when node loses its last subscriber — the hook for automatic cleanup (release dependencies, stop work, free caches).
override
update(ReactiveNode node) bool
Recomputes node's value in place and returns whether it actually changed. Returning false cuts propagation below node (this is where an equals policy plugs in).
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

instance ObserverEngine
The single engine instance behind the whole package.
final