ReactiveX/RxJava — pull request #1793 by benjchristensen (2014-10-23 21:23:07+00:00)
Title: Take/Redo Unsubscribe

Do not do further work after unsubscribed.

I added a fix to `take` on top of the change by @alexwen that fixes the source of the issue with `take`. It now unsubscribes before `onNext` so side-effects of `onNext` such as `request(n)` happen after `unsubscribe` and thus no further work will be scheduled.

I left the changes to `OnSubscribeRedo` as they are a good safety net in case another operator has a similar issue as `take` (an easy bug to creep in) as it does no harm to `redo` to have the `isUnsubscribed` check going forward.

Fixes #1791.