NitroCoalescer class
Web twin of NitroCoalescer — demultiplexer for coalesced
@nitroNativeAsync completions, backed by a WebReceivePort instead of a
ReceivePort.
The batch wire format is identical: the WASM side posts one int64 array of
[callId0, value0, …] (post tag 4) over a single shared port. Scalar
(int) results only.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- nativePort → int
-
The port id to hand to the WASM submit call so its coalescer can address
this demuxer.
no setter
- pendingCount → int
-
Number of calls still awaiting a result.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sendPort → WebSendPort
-
The WebSendPort batches are posted to. Most callers only need
nativePort; exposed for advanced use and testing (inject a batch
[callId0, value0, …]directly).no setter
Methods
-
dispose(
{int drainTurns = 8}) → Future< void> -
Closes the shared port and settles every pending call. Drains up to
drainTurnsevent-loop turns first so already-posted results complete normally; whatever remains is completed with a StateError. Idempotent. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
submit(
void call(int callId, int nativePort)) → Future< int> -
Registers a pending call, invokes
callwith the freshly-assigned id and nativePort, and returns the future that completes when the batch carrying this id arrives. Throws a StateError if called after dispose — the port is closed, so the result could never arrive. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited