OnResilientSubscribe

class OnResilientSubscribe<T>(val source: <Error class: unknown class><T>, strictMode: Boolean)

OnResilientSubscribe returns an Observable holding a reference to the source Observable. Upon subscribing to it, when reaching call method, if the subscriber passed in isSafeSubscriber it will unwrap the Observer from the SafeSubscriber, re-wrap it with ResilientSubscriber and then subscribe it to the source Observable.

In case we need to subscribe with a SafeSubscriber to the source Observable via OnResilientSubscribe, we have to:

  1. Declare a custom SafeSubscriber extending SafeSubscriber.

  2. Wrap our rx.Observer -to be subscribed to the source Observable- with the custom SafeSubscriber.

  3. Create a OnResilientSubscribe object with strictMode = false.

  4. Call Observable.unsafeCreate passing in as argument the OnResilientSubscribe.

  5. Subscribe to the returned Observable passing in as argument the custom SafeSubscriber.

Constructors

Link copied to clipboard
constructor(source: <Error class: unknown class><T>, strictMode: Boolean)

Properties

Link copied to clipboard
val source: <Error class: unknown class><T>

Functions

Link copied to clipboard
open fun call(subscriber: <Error class: unknown class><in T>)