Netflix/RxJava — pull request #1008 by samueltardieu (2014-04-01 11:36:32+00:00)
Title: Fix premature garbage collection of subscriber

Keeping a weak binding onto the subscriber makes it possible to prematurely get the subscriber garbage collected if there are no other references to it.

Here, we chose to pass around the component to which the subscriber is tied in form of a pair (`BoundPayload`). This allows the subscribers to get a reference on the (guaranteed non-collected) target without keeping it in the closure.

This introduces an interface change, but the current implementation is wrong and should never be used (see issues #979 and #1006).

An example usage can be seen at https://github.com/samueltardieu/cgeo/blob/bound-payload/main/src/cgeo/geocaching/PocketQueryList.java#L50 where `selectFromPocketQueries` references the target activity through `pocketQueryLists.target` in the subscriber.

cc @mttkay