ResilientSubscriber

class ResilientSubscriber<T>(actual: <Error class: unknown class><in T>)

Extends SafeSubscriber to override SafeSubscriber.onNext, SafeSubscriber.onError and SafeSubscriber._onError.

ResilientSubscriber will not set SafeSubscriber.done flag to true nor will call SafeSubscriber.unsubscribe upon error inside Observer.onNext. This way, the ResilientSubscriber will not get unsubscribed and therefore the underlying Observer will not get removed.

An Observer that will not get removed due to errors in onNext events becomes useful when an unsubscribe could lead to a malfunctioning CorDapp, due to a single isolated error. If the Observer gets removed, it will no longer be available the next time any events are pushed from the base Subject.

Constructors

Link copied to clipboard
constructor(actual: <Error class: unknown class><in T>)

Functions

Link copied to clipboard
open fun _onError(e: Throwable)

Duplicate of SafeSubscriber._onError. However, it will not call Subscriber.unsubscribe.

Link copied to clipboard
open fun onError(e: Throwable)

Duplicate of SafeSubscriber.onError. However, it will not set SafeSubscriber.done flag to true.

Link copied to clipboard
open fun onNext(t: T)

Duplicate of SafeSubscriber.onNext. However, it ignores SafeSubscriber.done flag. It only delegates to SafeSubscriber.onError if it wraps an ActionSubscriber which is a leaf in an Subscribers' tree structure.