airbnb / RxGroups

Easily group RxJava Observables together and tie them to your Android Activity lifecycle
Apache License 2.0
693 stars 44 forks source link

Add tagged observer to allow for custom tag #40

Closed BenSchwab closed 7 years ago

BenSchwab commented 7 years ago

In exceptional circumstances, it may be necessary to not use the tag created by AutoResubcriber. For example, if two observers in two instances of the same class in the same group need to co-exist.

BenSchwab commented 7 years ago

@elihart FYI I realized that we will still want TaggedObserver to be able to be @AutoResubscrible, so touch a little annotation processing code. Only difference is we don't generate code to set the tag for TaggedObserver.

After this PR I am planning on introducing an RxGroupLogger. This will log whenever an observer is transformed with a null tag (user forget to call lifecycle), and when an active observer is replaced from a collision.

I will allow this logger to be configured in debug builds to throw a runtime exception instead of logging.