Documentation / @eventkit/base / dlq
Function: dlq()
function dlq<T>(): UnaryFunction<AsyncObservable<T>, [AsyncObservable<T>, AsyncObservable<any>]>
Returns an array with two observables with the purpose of imposing a dead letter queue on the source observable; the first observable being the values that are emitted on the source, and the second one representing errors that were thrown when executing callback actions.
Since the execution of an observable is arbitrary (subscribers will start/stop at any time), a subscription to the errors observable is indefinitely active, but will only yield errors that come from active subscribers. This also means that any active subscriptions against the errors observable won't schedule blocking work against the parent scheduler (i.e. awaiting the source observable won't wait for the errors observable to complete).
Note: this will only yield errors that happen in subscriber callbacks. If an error occurs elsewhere (like in cleanup or in the observable's generator), that implies a cancellation and the error will be raised as normal.
Type Parameters
Type Parameter |
---|
T |
Returns
UnaryFunction
<AsyncObservable
<T
>, [AsyncObservable
<T
>, AsyncObservable
<any
>]>