Invoke the service as a function directly (RTK style).
Creates an event which cancels the current invocation.
Creates an event which indicates an invocation was canceled by a subscriber.
Creates an event which indicates an invocation has terminated successfully.
Creates an event which indicates an invocation has terminated with an error.
Creates an event which indicates an invocation has produced data.
Creates an event which invokes the service.
Creates an event which signals an invocation has begun.
An Observable of just start
and canceled
events of this service.
The ActionCreator factories this service listens for, and responds with.
An untyped reference to the bus this service listens and triggers on
An Observable of just canceled
events of this service.
An Observable of just request
, cancel
events.
Contains the last error object, but becomes null
at the start of the next handling.
An Observable of just the complete
and error
events of this service.
An Observable of just the error
events of this service.
An Observable of all events of this service.
An Observable of just the complete
, error
, and canceled
events of this service.
Becomes false the Promise after isHandling becomes false, when no more requests are scheduled to start.
Indicates whether a handling is in progress. Use .value
, or subscribe()
for updates.
The namespace given at construction time
Creates an independent subscription, invoking callbacks on process lifecycle events
The next time (including the present) this service is inactive. Represents the completion of an already-running service.
The next time isActive turns from true to false. Represents the completion of a not-yet-running service.
An Observable of just the next
events of this service.
An Observable of just started
events.
Uses the reducer to aggregate the events that are produced from its handlers, emitting a new state for each action (de-duping is not done). Use .value
, or subscribe()
for updates.
An Observable of just started
, next
, complete
, error
, and canceled
events.
Adds a function to be called only once when stop() is invoked
Adds a finalizer to this subscription, so that finalization will be unsubscribed/called when this subscription is unsubscribed. If this subscription is already #closed, because it has already been unsubscribed, then whatever finalizer is passed to it will automatically be executed (unless the finalizer itself is also a closed subscription).
Closed Subscriptions cannot be added as finalizers to any subscription. Adding a closed subscription to a any subscription will result in no operation. (A noop).
Adding a subscription to itself, or adding null
or undefined
will not perform any
operation at all. (A noop).
Subscription
instances that are added to this instance will automatically remove themselves
if they are unsubscribed. Functions and Unsubscribable objects that you wish to remove
will need to be removed manually with #remove
The finalization logic to add to this subscription.
Completes the current handling, triggering actions.complete. If a value for final
is provided,
that is emitted via actions.next first. Useful to end the handling but signal a successful completion
to any observers/listeners.
Optional
final: TNextExplicitly pass a request object
Get a promise for the next response or error. Note: works best for a queueing service, otherwise may not be the response/error that was triggered by the request.
Optional
matcher: ((req, res) => boolean)matcher If an immediate mode (mergeMap) service, and you need a promise for a specific result, not just the first one, provide a function that takes a request and a response and returns true if the response belongs to that request.
Terminates the listener, any of its Observable handlings.
The closed subscription.
A service is a listener over a bus, which triggers responses in some combination to the requests it recieves. On each request it runs a handler (subject to its concurrency strategy) then triggers events based on that handler's lifecycle. For a service defined with the prefix "time", its event schema would be:
time/request
- client: requests the timetime/cancel
- client: cancel the current request for the timetime/started
- server: time resolution has beguntime/next
- server: contains the time as a payloadtime/complete
- server: no more times will be senttime/error
- server: an error occurred (the listener remains alive due to internal rescueing)time/canceled
- server: has canceled the current request for the time