InMemoryTransport class
A Transport implementation that routes frames through an InMemoryBus.
Two Passnote instances backed by the same bus synchronise without any sockets. This is the foundation of every engine-level test and is also usable for multi-isolate apps sharing a bus over ports.
- Implemented types
Constructors
- InMemoryTransport(InMemoryBus _bus)
- Creates a transport attached to InMemoryBus.
Properties
-
events
→ Stream<
PeerEvent> -
Stream of peer connection and disconnection events.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
-
inbound
→ Stream<
InboundFrame> -
Stream of frames received from remote peers.
no setteroverride
- nodeId → NodeId?
-
The NodeId assigned during start, or
nullbefore then.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
injectFrame(
NodeId from, Frame frame) → void - Called by InMemoryBus to deliver an inbound frame.
-
injectPeerConnected(
NodeId peer) → void - Called by InMemoryBus when a new peer appears on the bus.
-
injectPeerLost(
NodeId peer) → void - Called by InMemoryBus when a peer leaves the bus.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
send(
PeerId to, Frame frame) → Future< void> -
Sends
frameto the peer identified byto.override -
start(
{required NodeId self, required String appId}) → Future< void> -
Starts the transport, advertising
selfunderappId.override -
stop(
) → Future< void> -
Stops the transport, closing all active connections.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited