class · System.Reactive
Effect
public class System.Reactive.Effect : System.Any
A computation that runs again whenever a Source it read notifies, until disposed.
- Tipo
- class
- Espacio de nombres
- System.Reactive
- Ensamblado
- System.Core
- Acceso
- public, final
- Archivo fuente
Reactive.ant
Herencia
- Clases base
-
AnyEffect
Constructores
constructor Effect(body: func<> : void)
#
Propiedades
Métodos
method Run() -> void
#
Runs the computation, tracking what it reads (not while it already runs, nor once disposed). It starts from no dependencies: only what this run reads keeps running it.
method Trigger() -> void
#
What a change does to it: runs it, or (lazy) marks it stale once and notifies what depends on it.
method Dispose() -> void
#
Stops it: it never runs again, and no Source keeps it.
Miembros privados e internos (16)
field body: func<> : void
#
field sources: System.List<System.Reactive.Source>
#
field slots: System.List<i32>
#
For each source, its slot in that source's observers.
field ids: System.HashSet<i64>?
#
The ids of sources once there are more than a few (below that a search of the list is quicker).
Where it is in the batch's pending effects (while Pending).
How many times it let go of its sources: a Source's mark of one of its runs holds until then.
A lazy effect (a Computed's) does not run when notified: it goes stale, and tells Dependents.
field Dependents: System.Reactive.Source?
#
method Reads(source: System.Reactive.Source) -> bool
#
Whether this run read source already.
method Watching(source: System.Reactive.Source, slot: i32) -> i32
#
source keeps it in slot: where the source is in its list.
The source at back moved it to slot.
method Release() -> void
#
Miembros heredados (5)
GetTypemétodo de AnyUndescribedmétodo de AnyToStringmétodo de AnyHashmétodo de Anydestroymétodo de Any
Código fuente
Effect en Larva HIR, descompilado a partir de su Larva HIR.
// A computation that runs again whenever a Source it read notifies, until disposed.
public class System.Reactive.Effect : System.Any
{
field body: func<> : void
field running: bool
field disposed: bool
field sources: System.List<System.Reactive.Source>
// For each source, its slot in that source's observers.
field slots: System.List<i32>
// The ids of `sources` once there are more than a few (below that a search of the list is quicker).
field ids: System.HashSet<i64>?
field Pending: bool
// Where it is in the batch's pending effects (while Pending).
field PendingAt: i32
// How many times it let go of its sources: a Source's mark of one of its runs holds until then.
field Runs: i64
// A lazy effect (a Computed's) does not run when notified: it goes stale, and tells `Dependents`.
field Lazy: bool
field Stale: bool
field Dependents: System.Reactive.Source?
// Whether this run read `source` already.
method Reads(source: System.Reactive.Source) -> bool
// `source` keeps it in `slot`: where the source is in its list.
method Watching(source: System.Reactive.Source, slot: i32) -> i32
// The source at `back` moved it to `slot`.
method Moved(back: i32, slot: i32) -> void
method Release() -> void
constructor Effect(body: func<> : void)
// Runs the computation, tracking what it reads (not while it already runs, nor once disposed). It starts
// from no dependencies: only what this run reads keeps running it.
method Run() -> void
// What a change does to it: runs it, or (lazy) marks it stale once and notifies what depends on it.
method Trigger() -> void
// Stops it: it never runs again, and no Source keeps it.
method Dispose() -> void
// How many sources its last run read.
property Sources: i32
property Disposed: bool
}