GossipProtocol<T> class
Production-ready Gossip Protocol implementation
Constructors
- GossipProtocol.create({required String nodeId, required String address, required int port, GossipConfig? config, bool isTestMode = false})
- Creates a new gossip protocol instance
Properties
- config → GossipConfig
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
membership
→ List<
GossipNode< T> > -
Gets current membership
no setter
-
membershipStream
→ Stream<
GossipNode< T> > -
Gets membership update stream
no setter
-
messages
→ List<
GossipMessage> -
Gets current message store
no setter
-
messageStream
→ Stream<
GossipMessage> -
Gets message stream
no setter
- nodeId → String
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addNode(
String nodeId, String address, int port) → void - Adds a new node to the membership
-
gossip(
T payload, {GossipMessageType type = GossipMessageType.data}) → void - Gossips a message to the network
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeNode(
String nodeId) → void - Removes a node from the membership
-
start(
) → void - Starts the gossip protocol
-
stop(
) → void - Stops the gossip protocol
-
toJson(
) → Map< String, dynamic> - Serializes the protocol state
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited