DVModelSync class
The model sync hub.
Not a realtime facade — the spec forbids one. This is the delivery
mechanism generated model watch/sync APIs are built on: typed change
streams per model type, with tenant filtering and policy checks applied
before delivery.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
decodableNames
→ Set<
String> -
Wire names that can be decoded from an incoming envelope.
no setter
-
syncedTypes
→ Set<
Type> -
The model types with a live sync channel, and the wire names their
codecs are registered under.
no setter
Static Methods
-
changes<
T> ({bool allTenants = false}) → Stream< DVModelChange< T> > -
Typed change stream for
T. -
publish<
T> (T model, {DVModelChangeKind kind = DVModelChangeKind.updated}) → Future< void> - Publishes a change to local watchers and, when a transport is connected and a codec is registered, outward.
-
registerCodec<
T> ({required String name, required Map< String, Object?> encode(T model), required T decode(Map<String, Object?> json)}) → void -
Registers the codec a transport needs to carry
Tacross the wire. In-process delivery works without one. -
registerPolicy<
T> (bool canSee(T model)) → void -
Registers a policy filter for
T. A change whose model fails the check is not delivered — policy runs before delivery, not in the UI. -
reset(
) → Future< void> - Drops all registrations and closes streams. Intended for tests.
-
useTransport(
DVModelSyncTransport transport) → void - Connects the cross-process transport. Locally published changes are forwarded outward; arriving envelopes are republished locally.