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
- didAllRequestsReceivedEOSE → bool
-
checks if all requests received EOSE
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<
String, 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(
String url, List< Filter> filters) → void - Adds single relay request to the state
-
checkNetworkClose(
) → dynamic - checks if all relays recieved EOSE or failed and closes the request
-
close(
) → Future< void> - closes all streams
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited