RequestRegistry class

Tracks pending outgoing requests, handles timeouts.

Constructors

RequestRegistry({Duration defaultTimeout = const Duration(seconds: 30)})

Properties

defaultTimeout → Duration
final
hashCode → int
The hash code for this object.
no setterinherited
hasPending → bool
Whether any requests are pending.
no setter
oldestPendingAge → Duration?
Duration since the oldest pending request was registered.
no setter
pendingCount → int
Number of currently pending requests.
no setter
pendingIds → List<String>
Get all pending request IDs.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

cancel(String id, [String? reason]) → bool
Cancel a pending request by id.
cancelAll([String? reason]) → void
Cancel all pending requests.
complete(BridgeResponse response) → bool
Complete a pending request with a response. Returns true if the request was found and completed.
getPending(String id) → BridgeRequest?
Get info about a pending request.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
register(BridgeRequest request) → Future<BridgeResponse>
Register a new outgoing request. Returns a future that completes with the response (or errors on timeout / cancellation).
toString() → String
A string representation of this object.
inherited

Operators

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