NetworkStream<T extends NetworkStreamConfig, M extends IMessage<IMessageType>> class abstract

Configuration for a coordination session used to manage network nodes.

Implemented types
Implementers

Constructors

NetworkStream(T config, {List<Node>? producers, List<Node>? consumers})
Creates a network stream with the given NetworkStreamConfig. Optionally, initial lists of producer and consumer nodes can be provided. If a node is both a producer and consumer, it will be in both lists.

Properties

carriesSenderClock → bool
Whether this transport already puts the sender's clock on the wire.
no setter
channelCount → int
Number of channels in the stream.
no setter
clockSyncs → Stream<ClockSyncSample>
Clock-offset estimates for this stream's peers, as they are made.
no setter
config → T
Configuration for the stream. This is a NetworkStreamConfig object.
final
consumers → List<String>
List of consumer node IDs.
no setter
created → bool
Indicates whether the ILifecycle implementation has been created.
no setterinherited
dataType → StreamDataType
Data type of the stream. This is a StreamDataType enum value.
no setter
description → String?
Returns a description of the identity.
no setterinherited
disposed → bool
Indicates whether the ILifecycle implementation has been disposed.
no setterinherited
hasConsumers → bool
Whether the stream has any current consumers.
no setter
hashCode → int
The hash code for this object.
no setterinherited
hasProducers → bool
Whether the stream has any current producers.
no setter
id → String
Identifier for the stream, derived from the config hash code.
no setteroverride
inbox → Stream<M>
Incoming messages from peers.
no setter
manager → IResourceManager?
gets the resource manager that manages this resource
no setterinherited
messageClass → Type
no setter
name → String
Human-readable name for the stream.
no setteroverride
outbox → StreamSink<M>
no setter
outletConsumerPresence → Stream<bool>
Emits when this stream's publishing endpoint gains or loses every subscriber, where the transport can tell.
no setter
paused → bool
no setteroverride
producers → List<String>
List of producer node IDs.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sampleRate → double
Sample rate of the stream.
no setter
sharesSenderClockDomain → bool
Whether both ends of this stream read the same PeerClock.
no setter
started → bool
Whether the stream is currently running.
no setter
uId → String
Returns a unique identifier that is guaranteed to be globally unique.
no setterinherited

Methods

addConsumer(Node consumer) → void
Adds a consumer node to this stream.
addInlet(PeerHandle handle) → Future<void>
Subscribes to a peer found by discovery.
addProducer(Node producer) → void
Adds a producer node to this stream.
create() → FutureOr<void>
Creates.
inherited
createInletsForNodes(Iterable<Node> nodes, {Duration resolveTimeout = const Duration(seconds: 10)}) → Future<void>
Subscribes to every node in nodes, resolving their endpoints first.
createOutlet() → Future<void>
Creates this node's publishing endpoint.
destroyStream() → Future<void>
Stops and releases the stream's endpoints.
dispose() → FutureOr<void>
Disposes the ILifecycle implementation, releasing any resources.
inherited
flushStreams() → Future<void>
Discards anything buffered.
isConsumer(Node node) → bool
Checks if a given node is a consumer for this stream.
isProducer(Node node) → bool
Checks if a given node is a producer for this stream.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pause() → FutureOr<void>
Pauses the implementation.
override
pauseStream() → Future<void>
Pauses, if running and not already paused.
recreateOutlet() → Future<void>
Recreates the publishing endpoint to reflect a changed Node.
removeInlet(String nodeUId) → Future<void>
Unsubscribes from a peer, releasing whatever that inlet holds.
resume() → FutureOr<void>
Resumes the implementation.
override
resumeStream({bool flushBeforeResume = true}) → Future<void>
Resumes, if running and paused.
resumeWith({bool flushBeforeResume = true}) → Future<void>
Resumes, optionally discarding data buffered while paused.
sendMessage(M message) → FutureOr<void>
start() → Future<void>
Begins publishing and delivering. Idempotent.
stop() → Future<void>
Stops publishing and delivering, but keeps the stream usable.
toString() → String
A string representation of this object.
inherited
updateManager(IResourceManager? newManager) → FutureOr<void>
inherited
updateNode(Node newNode) → void
Replaces the Node this stream publishes as.

Operators

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