RequestState class

State per request for multiple relays

Constructors

RequestState(NdkRequest request)
Creates a new RequestState instance

Properties

cacheController ↔ StreamController<Nip01Event>
cacheController is the controller cacheRead writes to
getter/setter pair
controller ↔ ReplaySubject<Nip01Event>
getter/setter pair
didAllRequestsFinish → bool
checks if all requests finished (received EOSE or CLOSED)
no setter
hashCode → int
The hash code for this object.
no setterinherited
id → String
request id
no setter
isSubscription → bool
is this a subscription?
no setter
networkController ↔ StreamController<Nip01Event>
networkController used by engines to write their response
getter/setter pair
onTimeout ↔ dynamic Function(RequestState)?
called when timeout is triggered
getter/setter pair
request ↔ NdkRequest
the original request
getter/setter pair
requests ↔ Map<RelayConnectionKey, RelayRequestState>
! our requests tracking obj
getter/setter pair
returnedIds ↔ Set<String>
ids that got already returned by this request
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stream → Stream<Nip01Event>
no setter
timeoutDuration ↔ Duration?
timeout duration, closes all streams
getter/setter pair
unresolvedFilters → List<Filter>
this is the working filter obj, gets initialized with user provided filters. Then on each step (cache, network) resolved filters get removed/updated
final

Methods

addRequest(RelayConnectionKey key, List<Filter> filters) → void
Adds single relay request to the state
cancelTimeout() → void
Cancels the timeout timer without closing streams. Used when a duplicate request is detected and this request's stream will be fed from another in-flight request.
close() → Future<void>
closes all streams
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pauseTimeout() → void
Pauses the timeout timer. Call this before signing starts.
resumeTimeout() → void
Resumes the timeout timer. Call this after signing completes.
toString() → String
A string representation of this object.
inherited

Operators

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