Netflix/RxJava — pull request #1190 by akarnokd (2014-05-12 08:14:38+00:00)
Title: Scheduler fixes and related improvements

A newer set of scheduler improvements.

- Fixed ```schedulePeriodic``` to properly capture the Subscription of the repeated schedule calls to allow unsubscribing the periodic task without the need to unsubscribe the whole worker.
- Fixed ```NewThreadScheduler``` to call ```shutdownNow``` to correctly cancel all pending tasks.
- Removed ```innerSubscription``` from ```NewThreadScheduler``` because it was unnecessary and didn't even work.
- Took ```CompositeSubscription``` from #1145 to improve on the add/removal time of timed tasks with a help of a ```HashSet``` and atomic field updaters.
- Added ```SubscriptionQueue``` that works like an ringbuffer and can add/remove non-delayed tasks faster than ```CompositeSubscription```.
- Reduced memory footprint of ```CompositeSubscription``` and ```ScheduledAction```.
- Modified ```EventLoopScheduler``` to track delayed and non-delayed task Subscriptions separately.
- Added a few ```final``` modifiers.