WsDiscovery class
IDiscovery backed by the hub's peer registry.
The hub already knows who is connected, so a query is a round trip rather than a network resolve — but the timing contract is the same as LSL's, which matters for election. See discoverOnce.
- Inheritance
-
- Object
- ManagedResource
- WsDiscovery
- Implemented types
Constructors
- WsDiscovery({required WsConnection connection, required CoordinationConfig coordinationConfig, required String id, IResourceManager? manager})
Properties
- connection → WsConnection
-
final
- coordinationConfig → CoordinationConfig
-
final
- created → bool
-
Indicates whether the ILifecycle implementation has been created.
no setterinherited
- description → String?
-
Returns a description of the identity.
no setterinherited
- disposed → bool
-
Indicates whether the ILifecycle implementation has been disposed.
no setterinherited
-
events
→ Stream<
DiscoveryEvent> -
Peers found by the continuous discovery started with start.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
Returns a unique identifier for the identity.
finalinherited
- manager → IResourceManager?
-
gets the resource manager that manages this resource
no setterinherited
- name → String
-
Returns a human-readable name for the identity.
no setterinherited
- paused → bool
-
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shadowUId ↔ String?
-
getter/setter pairinherited
- uId → String
-
Returns a unique identifier that is guaranteed to be globally unique.
no setterinherited
Methods
-
create(
) → FutureOr< void> -
Marks the resource created.
inherited
-
discoverOnce(
DiscoveryQuery query, {Duration timeout = const Duration(seconds: 2), int minPeers = 0, int maxPeers = 10}) → Future< List< PeerHandle> > -
Runs a single bounded discovery.
override
-
dispose(
) → Future< void> -
Disposes the ILifecycle implementation, releasing any resources.
override
-
manageResource<
R extends IResource> (R resource) → void -
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pause(
) → void -
Pauses the implementation.
override
-
releaseResource<
R extends IResource> (String resourceUId) → R -
override
-
resume(
) → void -
Resumes the implementation.
override
-
start(
{required DiscoveryQuery query, Duration? timeout, int? maxPeers}) → void -
Begins continuous discovery, reporting matches on events until stop.
override
-
stop(
) → void -
Stops continuous discovery. Safe to call when not running.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
updateManager(
IResourceManager? newManager) → void -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited