From 598afbb62b315caea218abc4615c17f2c12a3319 Mon Sep 17 00:00:00 2001 From: Ben Christensen Date: Tue, 22 Apr 2014 21:32:37 -0700 Subject: [PATCH] Scheduler.Inner -> Scheduler.Worker As per decision at https://github.com/Netflix/RxJava/issues/997#issuecomment-40998613 --- .../scala/rx/lang/scala/JavaConversions.scala | 4 +-- .../main/scala/rx/lang/scala/Scheduler.scala | 16 +++++----- .../schedulers/HandlerThreadScheduler.java | 4 +-- .../subscriptions/AndroidSubscriptions.java | 4 +-- .../HandlerThreadSchedulerTest.java | 6 ++-- .../src/main/java/rx/util/async/Async.java | 32 +++++++++---------- .../rx/util/async/operators/Functionals.java | 8 ++--- .../java/rx/quasar/NewFiberScheduler.java | 4 +-- .../java/rx/schedulers/SwingScheduler.java | 4 +-- .../rx/subscriptions/SwingSubscriptions.java | 4 +-- .../rx/swing/sources/SwingTestHelper.java | 4 +-- .../rx/schedulers/SwingSchedulerTest.java | 8 ++--- rxjava-core/src/main/java/rx/Scheduler.java | 12 ++++--- .../java/rx/operators/ChunkedOperation.java | 14 ++++---- .../java/rx/operators/OperationDebounce.java | 4 +-- .../java/rx/operators/OperationDelay.java | 4 +-- .../java/rx/operators/OperationInterval.java | 4 +-- .../main/java/rx/operators/OperationSkip.java | 4 +-- .../java/rx/operators/OperationTakeTimed.java | 4 +-- .../java/rx/operators/OperationTimer.java | 6 ++-- .../java/rx/operators/OperatorObserveOn.java | 4 +-- .../java/rx/operators/OperatorRepeat.java | 4 +-- .../main/java/rx/operators/OperatorRetry.java | 2 +- .../rx/operators/OperatorSubscribeOn.java | 4 +-- .../java/rx/operators/OperatorTimeout.java | 4 +-- .../rx/operators/OperatorTimeoutBase.java | 10 +++--- .../OperatorTimeoutWithSelector.java | 4 +-- .../rx/operators/OperatorUnsubscribeOn.java | 2 +- .../rx/schedulers/EventLoopsScheduler.java | 4 +-- .../rx/schedulers/ImmediateScheduler.java | 4 +-- .../rx/schedulers/NewThreadScheduler.java | 4 +-- .../java/rx/schedulers/SleepingAction.java | 4 +-- .../java/rx/schedulers/TestScheduler.java | 8 ++--- .../rx/schedulers/TrampolineScheduler.java | 4 +-- .../main/java/rx/subjects/TestSubject.java | 4 +-- .../schedulers/TestRecursionMemoryUsage.java | 4 +-- rxjava-core/src/test/java/rx/EventStream.java | 4 +-- .../rx/operators/OperationBufferTest.java | 4 +-- .../rx/operators/OperationDebounceTest.java | 4 +-- .../rx/operators/OperationSampleTest.java | 4 +-- .../rx/operators/OperationSwitchTest.java | 4 +-- .../operators/OperationThrottleFirstTest.java | 4 +-- .../rx/operators/OperationWindowTest.java | 4 +-- .../java/rx/operators/OperatorAmbTest.java | 4 +-- .../java/rx/operators/OperatorMergeTest.java | 8 ++--- .../rx/operators/OperatorSubscribeOnTest.java | 10 +++--- .../operators/OperatorUnsubscribeOnTest.java | 6 ++-- .../AbstractSchedulerConcurrencyTests.java | 14 ++++---- .../rx/schedulers/AbstractSchedulerTests.java | 14 ++++---- .../schedulers/ComputationSchedulerTests.java | 2 +- .../java/rx/schedulers/TestSchedulerTest.java | 4 +-- .../src/test/java/rx/test/OperatorTester.java | 4 +-- 52 files changed, 158 insertions(+), 156 deletions(-) diff --git a/language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala/JavaConversions.scala b/language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala/JavaConversions.scala index 9ebd7744d7..c1d03667b4 100644 --- a/language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala/JavaConversions.scala +++ b/language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala/JavaConversions.scala @@ -39,8 +39,8 @@ object JavaConversions { implicit def scalaSchedulerToJavaScheduler(s: Scheduler): rx.Scheduler = s.asJavaScheduler implicit def javaSchedulerToScalaScheduler(s: rx.Scheduler): Scheduler = Scheduler(s) - implicit def scalaInnerToJavaInner(s: Inner): rx.Scheduler.Inner = s.asJavaInner - implicit def javaInnerToScalaInner(s: rx.Scheduler.Inner): Inner = Inner(s) + implicit def scalaWorkerToJavaWorker(s: Worker): rx.Scheduler.Worker = s.asJavaWorker + implicit def javaWorkerToScalaWorker(s: rx.Scheduler.Worker): Worker = Worker(s) implicit def toJavaObserver[T](s: Observer[T]): rx.Observer[_ >: T] = s.asJavaObserver diff --git a/language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala/Scheduler.scala b/language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala/Scheduler.scala index c88ca3c875..6d5a24474f 100644 --- a/language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala/Scheduler.scala +++ b/language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala/Scheduler.scala @@ -42,22 +42,22 @@ trait Scheduler { */ def now: Long = this.asJavaScheduler.now() - def createInner: Inner = this.asJavaScheduler.createInner() + def createWorker: Worker = this.asJavaScheduler.createWorker() } -object Inner { - def apply(inner: rx.Scheduler.Inner): Inner = new Inner { private[scala] val asJavaInner = inner } +object Worker { + def apply(worker: rx.Scheduler.Worker): Worker = new Worker { private[scala] val asJavaWorker = worker } } -trait Inner extends Subscription { - private [scala] val asJavaInner: rx.Scheduler.Inner +trait Worker extends Subscription { + private [scala] val asJavaWorker: rx.Scheduler.Worker /** * Schedules a cancelable action to be executed in delayTime. */ def schedule(action: Unit => Unit, delayTime: Duration): Subscription = - this.asJavaInner.schedule( + this.asJavaWorker.schedule( new Action0 { override def call(): Unit = action() }, @@ -67,7 +67,7 @@ trait Inner extends Subscription { /** * Schedules a cancelable action to be executed immediately. */ - def schedule(action: Unit => Unit): Subscription = this.asJavaInner.schedule( + def schedule(action: Unit => Unit): Subscription = this.asJavaWorker.schedule( new Action0 { override def call(): Unit = action() } @@ -76,7 +76,7 @@ trait Inner extends Subscription { /** * @return the scheduler's notion of current absolute time in milliseconds. */ - def now: Long = this.asJavaInner.now() + def now: Long = this.asJavaWorker.now() } diff --git a/rxjava-contrib/rxjava-android/src/main/java/rx/android/schedulers/HandlerThreadScheduler.java b/rxjava-contrib/rxjava-android/src/main/java/rx/android/schedulers/HandlerThreadScheduler.java index 316480a5c2..0e786207c1 100644 --- a/rxjava-contrib/rxjava-android/src/main/java/rx/android/schedulers/HandlerThreadScheduler.java +++ b/rxjava-contrib/rxjava-android/src/main/java/rx/android/schedulers/HandlerThreadScheduler.java @@ -43,11 +43,11 @@ public HandlerThreadScheduler(Handler handler) { } @Override - public Inner createInner() { + public Worker createWorker() { return new InnerHandlerThreadScheduler(handler); } - private static class InnerHandlerThreadScheduler extends Inner { + private static class InnerHandlerThreadScheduler extends Worker { private final Handler handler; private BooleanSubscription innerSubscription = new BooleanSubscription(); diff --git a/rxjava-contrib/rxjava-android/src/main/java/rx/android/subscriptions/AndroidSubscriptions.java b/rxjava-contrib/rxjava-android/src/main/java/rx/android/subscriptions/AndroidSubscriptions.java index 7d5b622c64..3e0fc95b9b 100644 --- a/rxjava-contrib/rxjava-android/src/main/java/rx/android/subscriptions/AndroidSubscriptions.java +++ b/rxjava-contrib/rxjava-android/src/main/java/rx/android/subscriptions/AndroidSubscriptions.java @@ -15,7 +15,7 @@ */ package rx.android.subscriptions; -import rx.Scheduler.Inner; +import rx.Scheduler.Worker; import rx.Subscription; import rx.android.schedulers.AndroidSchedulers; import rx.functions.Action0; @@ -42,7 +42,7 @@ public void call() { if (Looper.getMainLooper() == Looper.myLooper()) { unsubscribe.call(); } else { - final Inner inner = AndroidSchedulers.mainThread().createInner(); + final Worker inner = AndroidSchedulers.mainThread().createWorker(); inner.schedule(new Action0() { @Override public void call() { diff --git a/rxjava-contrib/rxjava-android/src/test/java/rx/android/schedulers/HandlerThreadSchedulerTest.java b/rxjava-contrib/rxjava-android/src/test/java/rx/android/schedulers/HandlerThreadSchedulerTest.java index 14299340ca..8969e47a9e 100644 --- a/rxjava-contrib/rxjava-android/src/test/java/rx/android/schedulers/HandlerThreadSchedulerTest.java +++ b/rxjava-contrib/rxjava-android/src/test/java/rx/android/schedulers/HandlerThreadSchedulerTest.java @@ -29,7 +29,7 @@ import org.robolectric.annotation.Config; import rx.Scheduler; -import rx.Scheduler.Inner; +import rx.Scheduler.Worker; import rx.functions.Action0; import rx.functions.Action1; import android.os.Handler; @@ -45,7 +45,7 @@ public void shouldScheduleImmediateActionOnHandlerThread() { final Action0 action = mock(Action0.class); Scheduler scheduler = new HandlerThreadScheduler(handler); - Inner inner = scheduler.createInner(); + Worker inner = scheduler.createWorker(); inner.schedule(action); // verify that we post to the given Handler @@ -64,7 +64,7 @@ public void shouldScheduleDelayedActionOnHandlerThread() { final Action0 action = mock(Action0.class); Scheduler scheduler = new HandlerThreadScheduler(handler); - Inner inner = scheduler.createInner(); + Worker inner = scheduler.createWorker(); inner.schedule(action, 1L, TimeUnit.SECONDS); // verify that we post to the given Handler diff --git a/rxjava-contrib/rxjava-async-util/src/main/java/rx/util/async/Async.java b/rxjava-contrib/rxjava-async-util/src/main/java/rx/util/async/Async.java index acd4a86eee..159bf97bd5 100644 --- a/rxjava-contrib/rxjava-async-util/src/main/java/rx/util/async/Async.java +++ b/rxjava-contrib/rxjava-async-util/src/main/java/rx/util/async/Async.java @@ -22,7 +22,7 @@ import rx.Observable; import rx.Observer; import rx.Scheduler; -import rx.Scheduler.Inner; +import rx.Scheduler.Worker; import rx.Subscriber; import rx.Subscription; import rx.functions.Action0; @@ -599,7 +599,7 @@ public static Func0> toAsync(final Func0 func, fi @Override public Observable call() { final AsyncSubject subject = AsyncSubject.create(); - final Inner inner = scheduler.createInner(); + final Worker inner = scheduler.createWorker(); inner.schedule(new Action0() { @Override public void call() { @@ -659,7 +659,7 @@ public static Func1> toAsync(final Func1 call(final T1 t1) { final AsyncSubject subject = AsyncSubject.create(); - final Inner inner = scheduler.createInner(); + final Worker inner = scheduler.createWorker(); inner.schedule(new Action0() { @Override public void call() { @@ -721,7 +721,7 @@ public static Func2> toAsync(final Func2 call(final T1 t1, final T2 t2) { final AsyncSubject subject = AsyncSubject.create(); - final Inner inner = scheduler.createInner(); + final Worker inner = scheduler.createWorker(); inner.schedule(new Action0() { @Override public void call() { @@ -785,7 +785,7 @@ public static Func3> toAsync(final Fun @Override public Observable call(final T1 t1, final T2 t2, final T3 t3) { final AsyncSubject subject = AsyncSubject.create(); - final Inner inner = scheduler.createInner(); + final Worker inner = scheduler.createWorker(); inner.schedule(new Action0() { @Override public void call() { @@ -851,7 +851,7 @@ public static Func4> toAsync(f @Override public Observable call(final T1 t1, final T2 t2, final T3 t3, final T4 t4) { final AsyncSubject subject = AsyncSubject.create(); - final Inner inner = scheduler.createInner(); + final Worker inner = scheduler.createWorker(); inner.schedule(new Action0() { @Override public void call() { @@ -919,7 +919,7 @@ public static Func5> t @Override public Observable call(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5) { final AsyncSubject subject = AsyncSubject.create(); - final Inner inner = scheduler.createInner(); + final Worker inner = scheduler.createWorker(); inner.schedule(new Action0() { @Override public void call() { @@ -989,7 +989,7 @@ public static Func6 call(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6) { final AsyncSubject subject = AsyncSubject.create(); - final Inner inner = scheduler.createInner(); + final Worker inner = scheduler.createWorker(); inner.schedule(new Action0() { @Override public void call() { @@ -1061,7 +1061,7 @@ public static Func7 call(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7) { final AsyncSubject subject = AsyncSubject.create(); - final Inner inner = scheduler.createInner(); + final Worker inner = scheduler.createWorker(); inner.schedule(new Action0() { @Override public void call() { @@ -1135,7 +1135,7 @@ public static Func8 call(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8) { final AsyncSubject subject = AsyncSubject.create(); - final Inner inner = scheduler.createInner(); + final Worker inner = scheduler.createWorker(); inner.schedule(new Action0() { @Override public void call() { @@ -1211,7 +1211,7 @@ public static Func9 call(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9) { final AsyncSubject subject = AsyncSubject.create(); - final Inner inner = scheduler.createInner(); + final Worker inner = scheduler.createWorker(); inner.schedule(new Action0() { @Override public void call() { @@ -1267,7 +1267,7 @@ public static FuncN> toAsync(final FuncN func, fi @Override public Observable call(final Object... args) { final AsyncSubject subject = AsyncSubject.create(); - final Inner inner = scheduler.createInner(); + final Worker inner = scheduler.createWorker(); inner.schedule(new Action0() { @Override public void call() { @@ -1535,7 +1535,7 @@ public static FutureTask forEachFuture( Action1 onNext, Scheduler scheduler) { FutureTask task = OperationForEachFuture.forEachFuture(source, onNext); - final Inner inner = scheduler.createInner(); + final Worker inner = scheduler.createWorker(); inner.schedule(Functionals.fromRunnable(task, inner)); return task; } @@ -1563,7 +1563,7 @@ public static FutureTask forEachFuture( Action1 onError, Scheduler scheduler) { FutureTask task = OperationForEachFuture.forEachFuture(source, onNext, onError); - final Inner inner = scheduler.createInner(); + final Worker inner = scheduler.createWorker(); inner.schedule(Functionals.fromRunnable(task, inner)); return task; } @@ -1593,7 +1593,7 @@ public static FutureTask forEachFuture( Action0 onCompleted, Scheduler scheduler) { FutureTask task = OperationForEachFuture.forEachFuture(source, onNext, onError, onCompleted); - final Inner inner = scheduler.createInner(); + final Worker inner = scheduler.createWorker(); inner.schedule(Functionals.fromRunnable(task, inner)); return task; } @@ -1800,7 +1800,7 @@ public void call(Subscriber t1) { } }, csub); - final Inner inner = scheduler.createInner(); + final Worker inner = scheduler.createWorker(); csub.set(inner); inner.schedule(new Action0() { diff --git a/rxjava-contrib/rxjava-async-util/src/main/java/rx/util/async/operators/Functionals.java b/rxjava-contrib/rxjava-async-util/src/main/java/rx/util/async/operators/Functionals.java index b3c460ca2f..3dc96d0477 100644 --- a/rxjava-contrib/rxjava-async-util/src/main/java/rx/util/async/operators/Functionals.java +++ b/rxjava-contrib/rxjava-async-util/src/main/java/rx/util/async/operators/Functionals.java @@ -16,7 +16,7 @@ package rx.util.async.operators; -import rx.Scheduler.Inner; +import rx.Scheduler.Worker; import rx.functions.Action0; import rx.functions.Action1; @@ -66,7 +66,7 @@ public void call() { * @param run the Runnable to run when the Action0 is called * @return the Action0 wrapping the Runnable */ - public static Action0 fromRunnable(Runnable run, Inner inner) { + public static Action0 fromRunnable(Runnable run, Worker inner) { if (run == null) { throw new NullPointerException("run"); } @@ -75,9 +75,9 @@ public static Action0 fromRunnable(Runnable run, Inner inner) { /** An Action1 which wraps and calls a Runnable. */ private static final class ActionWrappingRunnable implements Action0 { final Runnable run; - final Inner inner; + final Worker inner; - public ActionWrappingRunnable(Runnable run, Inner inner) { + public ActionWrappingRunnable(Runnable run, Worker inner) { this.run = run; this.inner = inner; } diff --git a/rxjava-contrib/rxjava-quasar/src/main/java/rx/quasar/NewFiberScheduler.java b/rxjava-contrib/rxjava-quasar/src/main/java/rx/quasar/NewFiberScheduler.java index 8726f97feb..7893a447df 100644 --- a/rxjava-contrib/rxjava-quasar/src/main/java/rx/quasar/NewFiberScheduler.java +++ b/rxjava-contrib/rxjava-quasar/src/main/java/rx/quasar/NewFiberScheduler.java @@ -54,12 +54,12 @@ private NewFiberScheduler() { } @Override - public Inner createInner() { + public Worker createWorker() { return new EventLoopScheduler(); } - private class EventLoopScheduler extends Scheduler.Inner implements Subscription { + private class EventLoopScheduler extends Scheduler.Worker implements Subscription { private final CompositeSubscription innerSubscription = new CompositeSubscription(); private EventLoopScheduler() { diff --git a/rxjava-contrib/rxjava-swing/src/main/java/rx/schedulers/SwingScheduler.java b/rxjava-contrib/rxjava-swing/src/main/java/rx/schedulers/SwingScheduler.java index a7d4fff65d..e8d5529c8c 100644 --- a/rxjava-contrib/rxjava-swing/src/main/java/rx/schedulers/SwingScheduler.java +++ b/rxjava-contrib/rxjava-swing/src/main/java/rx/schedulers/SwingScheduler.java @@ -44,11 +44,11 @@ public static SwingScheduler getInstance() { } @Override - public Inner createInner() { + public Worker createWorker() { return new InnerSwingScheduler(); } - private static class InnerSwingScheduler extends Inner { + private static class InnerSwingScheduler extends Worker { private final CompositeSubscription innerSubscription = new CompositeSubscription(); diff --git a/rxjava-contrib/rxjava-swing/src/main/java/rx/subscriptions/SwingSubscriptions.java b/rxjava-contrib/rxjava-swing/src/main/java/rx/subscriptions/SwingSubscriptions.java index 7f8d08b040..1099bbc240 100644 --- a/rxjava-contrib/rxjava-swing/src/main/java/rx/subscriptions/SwingSubscriptions.java +++ b/rxjava-contrib/rxjava-swing/src/main/java/rx/subscriptions/SwingSubscriptions.java @@ -17,7 +17,7 @@ import javax.swing.SwingUtilities; -import rx.Scheduler.Inner; +import rx.Scheduler.Worker; import rx.Subscription; import rx.functions.Action0; import rx.schedulers.SwingScheduler; @@ -41,7 +41,7 @@ public void call() { if (SwingUtilities.isEventDispatchThread()) { unsubscribe.call(); } else { - final Inner inner = SwingScheduler.getInstance().createInner(); + final Worker inner = SwingScheduler.getInstance().createWorker(); inner.schedule(new Action0() { @Override public void call() { diff --git a/rxjava-contrib/rxjava-swing/src/main/java/rx/swing/sources/SwingTestHelper.java b/rxjava-contrib/rxjava-swing/src/main/java/rx/swing/sources/SwingTestHelper.java index 5a15b28c7b..1a34d026ae 100644 --- a/rxjava-contrib/rxjava-swing/src/main/java/rx/swing/sources/SwingTestHelper.java +++ b/rxjava-contrib/rxjava-swing/src/main/java/rx/swing/sources/SwingTestHelper.java @@ -18,7 +18,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import rx.Scheduler.Inner; +import rx.Scheduler.Worker; import rx.functions.Action0; import rx.schedulers.SwingScheduler; @@ -35,7 +35,7 @@ public static SwingTestHelper create() { } public SwingTestHelper runInEventDispatchThread(final Action0 action) { - Inner inner = SwingScheduler.getInstance().createInner(); + Worker inner = SwingScheduler.getInstance().createWorker(); inner.schedule(new Action0() { @Override diff --git a/rxjava-contrib/rxjava-swing/src/test/java/rx/schedulers/SwingSchedulerTest.java b/rxjava-contrib/rxjava-swing/src/test/java/rx/schedulers/SwingSchedulerTest.java index 9ba0dff645..36f57b1d1f 100644 --- a/rxjava-contrib/rxjava-swing/src/test/java/rx/schedulers/SwingSchedulerTest.java +++ b/rxjava-contrib/rxjava-swing/src/test/java/rx/schedulers/SwingSchedulerTest.java @@ -33,7 +33,7 @@ import org.junit.rules.ExpectedException; import org.mockito.InOrder; -import rx.Scheduler.Inner; +import rx.Scheduler.Worker; import rx.functions.Action0; /** @@ -48,7 +48,7 @@ public final class SwingSchedulerTest { @Test public void testInvalidDelayValues() { final SwingScheduler scheduler = new SwingScheduler(); - final Inner inner = scheduler.createInner(); + final Worker inner = scheduler.createWorker(); final Action0 action = mock(Action0.class); exception.expect(IllegalArgumentException.class); @@ -67,7 +67,7 @@ public void testInvalidDelayValues() { @Test public void testPeriodicScheduling() throws Exception { final SwingScheduler scheduler = new SwingScheduler(); - final Inner inner = scheduler.createInner(); + final Worker inner = scheduler.createWorker(); final CountDownLatch latch = new CountDownLatch(4); @@ -98,7 +98,7 @@ public void call() { @Test public void testNestedActions() throws Exception { final SwingScheduler scheduler = new SwingScheduler(); - final Inner inner = scheduler.createInner(); + final Worker inner = scheduler.createWorker(); final Action0 firstStepStart = mock(Action0.class); final Action0 firstStepEnd = mock(Action0.class); diff --git a/rxjava-core/src/main/java/rx/Scheduler.java b/rxjava-core/src/main/java/rx/Scheduler.java index 4f72f389e4..1d45006649 100644 --- a/rxjava-core/src/main/java/rx/Scheduler.java +++ b/rxjava-core/src/main/java/rx/Scheduler.java @@ -42,20 +42,22 @@ public abstract class Scheduler { /** - * Retrieve or create a new {@link Scheduler.Inner} that represents serial execution of actions. + * Retrieve or create a new {@link Scheduler.Worker} that represents serial execution of actions. *

- * When work is completed it should be unsubscribed. Work on a {@link Scheduler.Inner} is guaranteed to be sequential. + * When work is completed it should be unsubscribed using {@link Scheduler.Worker#unsubscribe()}. + *

+ * Work on a {@link Scheduler.Worker} is guaranteed to be sequential. * * @return Inner representing a serial queue of actions to be executed */ - public abstract Inner createInner(); + public abstract Worker createWorker(); /** * Sequential Scheduler for executing actions on a single thread or event loop. *

- * Unsubscribing the {@Inner} unschedules all outstanding work and allows resources cleanup. + * Unsubscribing the {@link Worker} unschedules all outstanding work and allows resources cleanup. */ - public abstract static class Inner implements Subscription { + public abstract static class Worker implements Subscription { /** * Schedules an Action for execution. diff --git a/rxjava-core/src/main/java/rx/operators/ChunkedOperation.java b/rxjava-core/src/main/java/rx/operators/ChunkedOperation.java index 6548b65d65..e8c5c80f15 100644 --- a/rxjava-core/src/main/java/rx/operators/ChunkedOperation.java +++ b/rxjava-core/src/main/java/rx/operators/ChunkedOperation.java @@ -27,7 +27,7 @@ import rx.Observable; import rx.Observer; import rx.Scheduler; -import rx.Scheduler.Inner; +import rx.Scheduler.Worker; import rx.Subscriber; import rx.Subscription; import rx.functions.Action0; @@ -155,7 +155,7 @@ protected static class TimeAndSizeBasedChunks extends Chunks impleme private final ConcurrentMap, Subscription> subscriptions = new ConcurrentHashMap, Subscription>(); - private final Scheduler.Inner scheduler; + private final Scheduler.Worker scheduler; private final long maxTime; private final TimeUnit unit; private final int maxSize; @@ -166,7 +166,7 @@ public TimeAndSizeBasedChunks(Observer observer, Func0 extends OverlappingChunks imp private final ConcurrentMap, Subscription> subscriptions = new ConcurrentHashMap, Subscription>(); - private final Scheduler.Inner scheduler; + private final Scheduler.Worker scheduler; private final long time; private final TimeUnit unit; private volatile boolean unsubscribed = false; @@ -249,7 +249,7 @@ public TimeBasedChunks(Observer observer, Func0 super(observer, chunkMaker); this.time = time; this.unit = unit; - this.scheduler = scheduler.createInner(); + this.scheduler = scheduler.createWorker(); } @Override @@ -608,7 +608,7 @@ protected static class TimeBasedChunkCreator implements ChunkCreator { private final MultipleAssignmentSubscription subscription = new MultipleAssignmentSubscription(); public TimeBasedChunkCreator(final NonOverlappingChunks chunks, long time, TimeUnit unit, Scheduler scheduler) { - Inner inner = scheduler.createInner(); + Worker inner = scheduler.createWorker(); this.subscription.set(inner); inner.schedulePeriodically(new Action0() { @Override @@ -619,7 +619,7 @@ public void call() { } public TimeBasedChunkCreator(final OverlappingChunks chunks, long time, TimeUnit unit, Scheduler scheduler) { - Inner inner = scheduler.createInner(); + Worker inner = scheduler.createWorker(); this.subscription.set(inner); inner.schedulePeriodically(new Action0() { @Override diff --git a/rxjava-core/src/main/java/rx/operators/OperationDebounce.java b/rxjava-core/src/main/java/rx/operators/OperationDebounce.java index 1d1913f4e0..6b112cc7f9 100644 --- a/rxjava-core/src/main/java/rx/operators/OperationDebounce.java +++ b/rxjava-core/src/main/java/rx/operators/OperationDebounce.java @@ -104,7 +104,7 @@ private static class DebounceObserver extends Subscriber { private final Observer observer; private final long timeout; private final TimeUnit unit; - private final Scheduler.Inner scheduler; + private final Scheduler.Worker scheduler; private final AtomicReference lastScheduledNotification = new AtomicReference(); @@ -114,7 +114,7 @@ public DebounceObserver(Observer observer, long timeout, TimeUnit uni this.observer = new SerializedObserver(observer); this.timeout = timeout; this.unit = unit; - this.scheduler = scheduler.createInner(); + this.scheduler = scheduler.createWorker(); } @Override diff --git a/rxjava-core/src/main/java/rx/operators/OperationDelay.java b/rxjava-core/src/main/java/rx/operators/OperationDelay.java index bd9d7e9400..79d03b2264 100644 --- a/rxjava-core/src/main/java/rx/operators/OperationDelay.java +++ b/rxjava-core/src/main/java/rx/operators/OperationDelay.java @@ -61,13 +61,13 @@ public static OnSubscribeFunc delaySubscription(Observable s /** Subscribe function which schedules the actual subscription to source on a scheduler at a later time. */ private static final class DelaySubscribeFunc implements OnSubscribeFunc { final Observable source; - final Scheduler.Inner scheduler; + final Scheduler.Worker scheduler; final long time; final TimeUnit unit; public DelaySubscribeFunc(Observable source, long time, TimeUnit unit, Scheduler scheduler) { this.source = source; - this.scheduler = scheduler.createInner(); + this.scheduler = scheduler.createWorker(); this.time = time; this.unit = unit; } diff --git a/rxjava-core/src/main/java/rx/operators/OperationInterval.java b/rxjava-core/src/main/java/rx/operators/OperationInterval.java index 2adbb3480f..ef036984b6 100644 --- a/rxjava-core/src/main/java/rx/operators/OperationInterval.java +++ b/rxjava-core/src/main/java/rx/operators/OperationInterval.java @@ -20,7 +20,7 @@ import rx.Observable.OnSubscribeFunc; import rx.Observer; import rx.Scheduler; -import rx.Scheduler.Inner; +import rx.Scheduler.Worker; import rx.Subscription; import rx.functions.Action0; import rx.schedulers.Schedulers; @@ -66,7 +66,7 @@ private Interval(long period, TimeUnit unit, Scheduler scheduler) { @Override public Subscription onSubscribe(final Observer observer) { - Inner inner = scheduler.createInner(); + Worker inner = scheduler.createWorker(); inner.schedulePeriodically(new Action0() { @Override public void call() { diff --git a/rxjava-core/src/main/java/rx/operators/OperationSkip.java b/rxjava-core/src/main/java/rx/operators/OperationSkip.java index 4a2684d873..f52b14374d 100644 --- a/rxjava-core/src/main/java/rx/operators/OperationSkip.java +++ b/rxjava-core/src/main/java/rx/operators/OperationSkip.java @@ -22,7 +22,7 @@ import rx.Observable.OnSubscribeFunc; import rx.Observer; import rx.Scheduler; -import rx.Scheduler.Inner; +import rx.Scheduler.Worker; import rx.Subscriber; import rx.Subscription; import rx.functions.Action0; @@ -60,7 +60,7 @@ public SkipTimed(Observable source, long time, TimeUnit unit, Sched @Override public Subscription onSubscribe(Observer t1) { - Inner inner = scheduler.createInner(); + Worker inner = scheduler.createWorker(); CompositeSubscription csub = new CompositeSubscription(inner); final SourceObserver so = new SourceObserver(t1, csub); csub.add(so); diff --git a/rxjava-core/src/main/java/rx/operators/OperationTakeTimed.java b/rxjava-core/src/main/java/rx/operators/OperationTakeTimed.java index a8f203089d..dd51c9e9e7 100644 --- a/rxjava-core/src/main/java/rx/operators/OperationTakeTimed.java +++ b/rxjava-core/src/main/java/rx/operators/OperationTakeTimed.java @@ -22,7 +22,7 @@ import rx.Observable.OnSubscribeFunc; import rx.Observer; import rx.Scheduler; -import rx.Scheduler.Inner; +import rx.Scheduler.Worker; import rx.Subscriber; import rx.Subscription; import rx.functions.Action0; @@ -191,7 +191,7 @@ public TakeTimed(Observable source, long time, TimeUnit unit, Sched @Override public Subscription onSubscribe(Observer t1) { - Inner inner = scheduler.createInner(); + Worker inner = scheduler.createWorker(); CompositeSubscription csub = new CompositeSubscription(inner); final SourceObserver so = new SourceObserver(t1, csub); csub.add(so); diff --git a/rxjava-core/src/main/java/rx/operators/OperationTimer.java b/rxjava-core/src/main/java/rx/operators/OperationTimer.java index 663ba359eb..e950cb07a8 100644 --- a/rxjava-core/src/main/java/rx/operators/OperationTimer.java +++ b/rxjava-core/src/main/java/rx/operators/OperationTimer.java @@ -20,7 +20,7 @@ import rx.Observable.OnSubscribeFunc; import rx.Observer; import rx.Scheduler; -import rx.Scheduler.Inner; +import rx.Scheduler.Worker; import rx.Subscription; import rx.functions.Action0; @@ -50,7 +50,7 @@ public TimerOnce(long dueTime, TimeUnit unit, Scheduler scheduler) { @Override public Subscription onSubscribe(final Observer t1) { - return scheduler.createInner().schedule(new Action0() { + return scheduler.createWorker().schedule(new Action0() { @Override public void call() { t1.onNext(0L); @@ -79,7 +79,7 @@ public TimerPeriodically(long initialDelay, long period, TimeUnit unit, Schedule @Override public Subscription onSubscribe(final Observer t1) { - Inner inner = scheduler.createInner(); + Worker inner = scheduler.createWorker(); inner.schedulePeriodically(new Action0() { long count; diff --git a/rxjava-core/src/main/java/rx/operators/OperatorObserveOn.java b/rxjava-core/src/main/java/rx/operators/OperatorObserveOn.java index 1424c3719f..9412ef8324 100644 --- a/rxjava-core/src/main/java/rx/operators/OperatorObserveOn.java +++ b/rxjava-core/src/main/java/rx/operators/OperatorObserveOn.java @@ -58,7 +58,7 @@ public Subscriber call(Subscriber child) { private static class ObserveOnSubscriber extends Subscriber { private final NotificationLite on = NotificationLite.instance(); final Subscriber observer; - private final Scheduler.Inner recursiveScheduler; + private final Scheduler.Worker recursiveScheduler; private final ConcurrentLinkedQueue queue = new ConcurrentLinkedQueue(); final AtomicLong counter = new AtomicLong(0); @@ -66,7 +66,7 @@ private static class ObserveOnSubscriber extends Subscriber { public ObserveOnSubscriber(Scheduler scheduler, Subscriber subscriber) { super(subscriber); this.observer = subscriber; - this.recursiveScheduler = scheduler.createInner(); + this.recursiveScheduler = scheduler.createWorker(); subscriber.add(recursiveScheduler); } diff --git a/rxjava-core/src/main/java/rx/operators/OperatorRepeat.java b/rxjava-core/src/main/java/rx/operators/OperatorRepeat.java index 5e335117d8..9ca9f75b9e 100644 --- a/rxjava-core/src/main/java/rx/operators/OperatorRepeat.java +++ b/rxjava-core/src/main/java/rx/operators/OperatorRepeat.java @@ -19,7 +19,7 @@ import rx.Observable; import rx.Observable.Operator; import rx.Scheduler; -import rx.Scheduler.Inner; +import rx.Scheduler.Worker; import rx.Subscriber; import rx.functions.Action0; import rx.observers.Subscribers; @@ -71,7 +71,7 @@ public void onError(Throwable e) { @Override public void onNext(final Observable t) { // will only be invoked once since we're nested - final Inner inner = scheduler.createInner(); + final Worker inner = scheduler.createWorker(); // cleanup on unsubscribe add(inner); inner.schedule(new Action0() { diff --git a/rxjava-core/src/main/java/rx/operators/OperatorRetry.java b/rxjava-core/src/main/java/rx/operators/OperatorRetry.java index bcd0c0965c..0422688b32 100644 --- a/rxjava-core/src/main/java/rx/operators/OperatorRetry.java +++ b/rxjava-core/src/main/java/rx/operators/OperatorRetry.java @@ -59,7 +59,7 @@ public OperatorRetry() { @Override public Subscriber> call(final Subscriber child) { - final Scheduler.Inner inner = scheduler.createInner(); + final Scheduler.Worker inner = scheduler.createWorker(); child.add(inner); final SerialSubscription serialSubscription = new SerialSubscription(); diff --git a/rxjava-core/src/main/java/rx/operators/OperatorSubscribeOn.java b/rxjava-core/src/main/java/rx/operators/OperatorSubscribeOn.java index bd095d196a..a59671e6a2 100644 --- a/rxjava-core/src/main/java/rx/operators/OperatorSubscribeOn.java +++ b/rxjava-core/src/main/java/rx/operators/OperatorSubscribeOn.java @@ -18,7 +18,7 @@ import rx.Observable; import rx.Observable.Operator; import rx.Scheduler; -import rx.Scheduler.Inner; +import rx.Scheduler.Worker; import rx.Subscriber; import rx.functions.Action0; @@ -37,7 +37,7 @@ public OperatorSubscribeOn(Scheduler scheduler) { @Override public Subscriber> call(final Subscriber subscriber) { - final Inner inner = scheduler.createInner(); + final Worker inner = scheduler.createWorker(); subscriber.add(inner); return new Subscriber>(subscriber) { diff --git a/rxjava-core/src/main/java/rx/operators/OperatorTimeout.java b/rxjava-core/src/main/java/rx/operators/OperatorTimeout.java index 0048810bd9..cbb587e38d 100644 --- a/rxjava-core/src/main/java/rx/operators/OperatorTimeout.java +++ b/rxjava-core/src/main/java/rx/operators/OperatorTimeout.java @@ -35,7 +35,7 @@ public OperatorTimeout(final long timeout, final TimeUnit timeUnit, Observable() { @Override - public Subscription call(final TimeoutSubscriber timeoutSubscriber, final Long seqId, Scheduler.Inner inner) { + public Subscription call(final TimeoutSubscriber timeoutSubscriber, final Long seqId, Scheduler.Worker inner) { return inner.schedule(new Action0() { @Override public void call() { @@ -46,7 +46,7 @@ public void call() { }, new TimeoutStub() { @Override - public Subscription call(final TimeoutSubscriber timeoutSubscriber, final Long seqId, T value, Scheduler.Inner inner) { + public Subscription call(final TimeoutSubscriber timeoutSubscriber, final Long seqId, T value, Scheduler.Worker inner) { return inner.schedule(new Action0() { @Override public void call() { diff --git a/rxjava-core/src/main/java/rx/operators/OperatorTimeoutBase.java b/rxjava-core/src/main/java/rx/operators/OperatorTimeoutBase.java index b78217b09f..10aa4ffd67 100644 --- a/rxjava-core/src/main/java/rx/operators/OperatorTimeoutBase.java +++ b/rxjava-core/src/main/java/rx/operators/OperatorTimeoutBase.java @@ -37,7 +37,7 @@ class OperatorTimeoutBase implements Operator { * @param */ /* package-private */static interface FirstTimeoutStub extends - Func3, Long, Scheduler.Inner, Subscription> { + Func3, Long, Scheduler.Worker, Subscription> { } /** @@ -46,7 +46,7 @@ class OperatorTimeoutBase implements Operator { * @param */ /* package-private */static interface TimeoutStub extends - Func4, Long, T, Scheduler.Inner, Subscription> { + Func4, Long, T, Scheduler.Worker, Subscription> { } private final FirstTimeoutStub firstTimeoutStub; @@ -63,7 +63,7 @@ class OperatorTimeoutBase implements Operator { @Override public Subscriber call(Subscriber subscriber) { - Scheduler.Inner inner = scheduler.createInner(); + Scheduler.Worker inner = scheduler.createWorker(); subscriber.add(inner); final SerialSubscription serial = new SerialSubscription(); subscriber.add(serial); @@ -90,13 +90,13 @@ public Subscriber call(Subscriber subscriber) { private final TimeoutStub timeoutStub; private final Observable other; - private final Scheduler.Inner inner; + private final Scheduler.Worker inner; private TimeoutSubscriber( SerializedSubscriber serializedSubscriber, TimeoutStub timeoutStub, SerialSubscription serial, Observable other, - Scheduler.Inner inner) { + Scheduler.Worker inner) { super(serializedSubscriber); this.serializedSubscriber = serializedSubscriber; this.timeoutStub = timeoutStub; diff --git a/rxjava-core/src/main/java/rx/operators/OperatorTimeoutWithSelector.java b/rxjava-core/src/main/java/rx/operators/OperatorTimeoutWithSelector.java index cefbed566d..08be2be005 100644 --- a/rxjava-core/src/main/java/rx/operators/OperatorTimeoutWithSelector.java +++ b/rxjava-core/src/main/java/rx/operators/OperatorTimeoutWithSelector.java @@ -43,7 +43,7 @@ public OperatorTimeoutWithSelector( @Override public Subscription call( final TimeoutSubscriber timeoutSubscriber, - final Long seqId, Scheduler.Inner inner) { + final Long seqId, Scheduler.Worker inner) { if (firstTimeoutSelector != null) { Observable o = null; try { @@ -80,7 +80,7 @@ public void onNext(U t) { @Override public Subscription call( final TimeoutSubscriber timeoutSubscriber, - final Long seqId, T value, Scheduler.Inner inner) { + final Long seqId, T value, Scheduler.Worker inner) { Observable o = null; try { o = timeoutSelector.call(value); diff --git a/rxjava-core/src/main/java/rx/operators/OperatorUnsubscribeOn.java b/rxjava-core/src/main/java/rx/operators/OperatorUnsubscribeOn.java index f7ddd8da99..82018b65c6 100644 --- a/rxjava-core/src/main/java/rx/operators/OperatorUnsubscribeOn.java +++ b/rxjava-core/src/main/java/rx/operators/OperatorUnsubscribeOn.java @@ -41,7 +41,7 @@ public Subscriber call(final Subscriber subscriber) { @Override public void call() { - final Scheduler.Inner inner = scheduler.createInner(); + final Scheduler.Worker inner = scheduler.createWorker(); inner.schedule(new Action0() { @Override diff --git a/rxjava-core/src/main/java/rx/schedulers/EventLoopsScheduler.java b/rxjava-core/src/main/java/rx/schedulers/EventLoopsScheduler.java index a5e3899368..ef41d86432 100644 --- a/rxjava-core/src/main/java/rx/schedulers/EventLoopsScheduler.java +++ b/rxjava-core/src/main/java/rx/schedulers/EventLoopsScheduler.java @@ -48,11 +48,11 @@ public EventLoopScheduler getEventLoop() { } @Override - public Inner createInner() { + public Worker createWorker() { return new EventLoop(); } - private static class EventLoop extends Scheduler.Inner { + private static class EventLoop extends Scheduler.Worker { private final CompositeSubscription innerSubscription = new CompositeSubscription(); private final EventLoopScheduler pooledEventLoop; private final OnActionComplete onComplete; diff --git a/rxjava-core/src/main/java/rx/schedulers/ImmediateScheduler.java b/rxjava-core/src/main/java/rx/schedulers/ImmediateScheduler.java index e74296fe81..cbc3a57d4e 100644 --- a/rxjava-core/src/main/java/rx/schedulers/ImmediateScheduler.java +++ b/rxjava-core/src/main/java/rx/schedulers/ImmediateScheduler.java @@ -37,11 +37,11 @@ public final class ImmediateScheduler extends Scheduler { } @Override - public Inner createInner() { + public Worker createWorker() { return new InnerImmediateScheduler(); } - private class InnerImmediateScheduler extends Scheduler.Inner implements Subscription { + private class InnerImmediateScheduler extends Scheduler.Worker implements Subscription { final BooleanSubscription innerSubscription = new BooleanSubscription(); diff --git a/rxjava-core/src/main/java/rx/schedulers/NewThreadScheduler.java b/rxjava-core/src/main/java/rx/schedulers/NewThreadScheduler.java index cebbdba64a..acbe6c81cc 100644 --- a/rxjava-core/src/main/java/rx/schedulers/NewThreadScheduler.java +++ b/rxjava-core/src/main/java/rx/schedulers/NewThreadScheduler.java @@ -55,11 +55,11 @@ private NewThreadScheduler() { } @Override - public Inner createInner() { + public Worker createWorker() { return new EventLoopScheduler(THREAD_FACTORY); } - /* package */static class EventLoopScheduler extends Scheduler.Inner implements Subscription { + /* package */static class EventLoopScheduler extends Scheduler.Worker implements Subscription { private final CompositeSubscription innerSubscription = new CompositeSubscription(); private final ExecutorService executor; diff --git a/rxjava-core/src/main/java/rx/schedulers/SleepingAction.java b/rxjava-core/src/main/java/rx/schedulers/SleepingAction.java index 3748b053ce..016df2d87e 100644 --- a/rxjava-core/src/main/java/rx/schedulers/SleepingAction.java +++ b/rxjava-core/src/main/java/rx/schedulers/SleepingAction.java @@ -20,10 +20,10 @@ /* package */class SleepingAction implements Action0 { private final Action0 underlying; - private final Scheduler.Inner innerScheduler; + private final Scheduler.Worker innerScheduler; private final long execTime; - public SleepingAction(Action0 underlying, Scheduler.Inner scheduler, long execTime) { + public SleepingAction(Action0 underlying, Scheduler.Worker scheduler, long execTime) { this.underlying = underlying; this.innerScheduler = scheduler; this.execTime = execTime; diff --git a/rxjava-core/src/main/java/rx/schedulers/TestScheduler.java b/rxjava-core/src/main/java/rx/schedulers/TestScheduler.java index 524f29fcd8..97ab4afdad 100644 --- a/rxjava-core/src/main/java/rx/schedulers/TestScheduler.java +++ b/rxjava-core/src/main/java/rx/schedulers/TestScheduler.java @@ -34,10 +34,10 @@ private static class TimedAction { private final long time; private final Action0 action; - private final Inner scheduler; + private final Worker scheduler; private final long count = counter++; // for differentiating tasks at same time - private TimedAction(Inner scheduler, long time, Action0 action) { + private TimedAction(Worker scheduler, long time, Action0 action) { this.time = time; this.action = action; this.scheduler = scheduler; @@ -99,11 +99,11 @@ private void triggerActions(long targetTimeInNanos) { } @Override - public Inner createInner() { + public Worker createWorker() { return new InnerTestScheduler(); } - private final class InnerTestScheduler extends Inner { + private final class InnerTestScheduler extends Worker { private BooleanSubscription s = new BooleanSubscription(); diff --git a/rxjava-core/src/main/java/rx/schedulers/TrampolineScheduler.java b/rxjava-core/src/main/java/rx/schedulers/TrampolineScheduler.java index af4cea9801..ea7f101600 100644 --- a/rxjava-core/src/main/java/rx/schedulers/TrampolineScheduler.java +++ b/rxjava-core/src/main/java/rx/schedulers/TrampolineScheduler.java @@ -36,7 +36,7 @@ public class TrampolineScheduler extends Scheduler { } @Override - public Inner createInner() { + public Worker createWorker() { return new InnerCurrentThreadScheduler(); } @@ -47,7 +47,7 @@ public Inner createInner() { private final AtomicInteger counter = new AtomicInteger(0); - private class InnerCurrentThreadScheduler extends Scheduler.Inner implements Subscription { + private class InnerCurrentThreadScheduler extends Scheduler.Worker implements Subscription { private final BooleanSubscription innerSubscription = new BooleanSubscription(); diff --git a/rxjava-core/src/main/java/rx/subjects/TestSubject.java b/rxjava-core/src/main/java/rx/subjects/TestSubject.java index ef5fc99370..7b9fb69e32 100644 --- a/rxjava-core/src/main/java/rx/subjects/TestSubject.java +++ b/rxjava-core/src/main/java/rx/subjects/TestSubject.java @@ -90,13 +90,13 @@ public void call(SubjectObserver o) { private final SubjectSubscriptionManager subscriptionManager; private final AtomicReference> lastNotification; - private final Scheduler.Inner innerScheduler; + private final Scheduler.Worker innerScheduler; protected TestSubject(OnSubscribe onSubscribe, SubjectSubscriptionManager subscriptionManager, AtomicReference> lastNotification, TestScheduler scheduler) { super(onSubscribe); this.subscriptionManager = subscriptionManager; this.lastNotification = lastNotification; - this.innerScheduler = scheduler.createInner(); + this.innerScheduler = scheduler.createWorker(); } @Override diff --git a/rxjava-core/src/perf/java/rx/archive/schedulers/TestRecursionMemoryUsage.java b/rxjava-core/src/perf/java/rx/archive/schedulers/TestRecursionMemoryUsage.java index 6335dc2109..7fc70cdd9d 100644 --- a/rxjava-core/src/perf/java/rx/archive/schedulers/TestRecursionMemoryUsage.java +++ b/rxjava-core/src/perf/java/rx/archive/schedulers/TestRecursionMemoryUsage.java @@ -18,7 +18,7 @@ import rx.Observable; import rx.Observable.OnSubscribe; import rx.Scheduler; -import rx.Scheduler.Inner; +import rx.Scheduler.Worker; import rx.Subscriber; import rx.functions.Action0; import rx.schedulers.Schedulers; @@ -42,7 +42,7 @@ protected static void testScheduler(final Scheduler scheduler) { @Override public void call(final Subscriber o) { - final Inner inner = scheduler.createInner(); + final Worker inner = scheduler.createWorker(); o.add(inner); inner.schedule(new Action0() { diff --git a/rxjava-core/src/test/java/rx/EventStream.java b/rxjava-core/src/test/java/rx/EventStream.java index a300fc977c..7354ae82ca 100644 --- a/rxjava-core/src/test/java/rx/EventStream.java +++ b/rxjava-core/src/test/java/rx/EventStream.java @@ -20,7 +20,7 @@ import java.util.Map; import rx.Observable.OnSubscribe; -import rx.Scheduler.Inner; +import rx.Scheduler.Worker; import rx.functions.Action0; import rx.schedulers.Schedulers; @@ -34,7 +34,7 @@ public static Observable getEventStream(final String type, final int numI @Override public void call(final Subscriber subscriber) { - Inner inner = Schedulers.newThread().createInner(); + Worker inner = Schedulers.newThread().createWorker(); subscriber.add(inner); // run on a background thread inside the OnSubscribeFunc so unsubscribe works inner.schedule(new Action0() { diff --git a/rxjava-core/src/test/java/rx/operators/OperationBufferTest.java b/rxjava-core/src/test/java/rx/operators/OperationBufferTest.java index 695379b840..aa1c525e99 100644 --- a/rxjava-core/src/test/java/rx/operators/OperationBufferTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperationBufferTest.java @@ -50,14 +50,14 @@ public class OperationBufferTest { private Observer> observer; private TestScheduler scheduler; - private Scheduler.Inner innerScheduler; + private Scheduler.Worker innerScheduler; @Before @SuppressWarnings("unchecked") public void before() { observer = Mockito.mock(Observer.class); scheduler = new TestScheduler(); - innerScheduler = scheduler.createInner(); + innerScheduler = scheduler.createWorker(); } @Test diff --git a/rxjava-core/src/test/java/rx/operators/OperationDebounceTest.java b/rxjava-core/src/test/java/rx/operators/OperationDebounceTest.java index ab6ff62c31..7cf989a02a 100644 --- a/rxjava-core/src/test/java/rx/operators/OperationDebounceTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperationDebounceTest.java @@ -43,14 +43,14 @@ public class OperationDebounceTest { private TestScheduler scheduler; private Observer observer; - private Scheduler.Inner innerScheduler; + private Scheduler.Worker innerScheduler; @Before @SuppressWarnings("unchecked") public void before() { scheduler = new TestScheduler(); observer = mock(Observer.class); - innerScheduler = scheduler.createInner(); + innerScheduler = scheduler.createWorker(); } @Test diff --git a/rxjava-core/src/test/java/rx/operators/OperationSampleTest.java b/rxjava-core/src/test/java/rx/operators/OperationSampleTest.java index 39dae6778d..7e4a39b2cd 100644 --- a/rxjava-core/src/test/java/rx/operators/OperationSampleTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperationSampleTest.java @@ -39,7 +39,7 @@ public class OperationSampleTest { private TestScheduler scheduler; - private Scheduler.Inner innerScheduler; + private Scheduler.Worker innerScheduler; private Observer observer; private Observer observer2; @@ -48,7 +48,7 @@ public class OperationSampleTest { // due to mocking public void before() { scheduler = new TestScheduler(); - innerScheduler = scheduler.createInner(); + innerScheduler = scheduler.createWorker(); observer = mock(Observer.class); observer2 = mock(Observer.class); } diff --git a/rxjava-core/src/test/java/rx/operators/OperationSwitchTest.java b/rxjava-core/src/test/java/rx/operators/OperationSwitchTest.java index 8ee61765ed..a0d6fede6b 100644 --- a/rxjava-core/src/test/java/rx/operators/OperationSwitchTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperationSwitchTest.java @@ -40,14 +40,14 @@ public class OperationSwitchTest { private TestScheduler scheduler; - private Scheduler.Inner innerScheduler; + private Scheduler.Worker innerScheduler; private Observer observer; @Before @SuppressWarnings("unchecked") public void before() { scheduler = new TestScheduler(); - innerScheduler = scheduler.createInner(); + innerScheduler = scheduler.createWorker(); observer = mock(Observer.class); } diff --git a/rxjava-core/src/test/java/rx/operators/OperationThrottleFirstTest.java b/rxjava-core/src/test/java/rx/operators/OperationThrottleFirstTest.java index 73833e4b40..244e9a6878 100644 --- a/rxjava-core/src/test/java/rx/operators/OperationThrottleFirstTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperationThrottleFirstTest.java @@ -37,14 +37,14 @@ public class OperationThrottleFirstTest { private TestScheduler scheduler; - private Scheduler.Inner innerScheduler; + private Scheduler.Worker innerScheduler; private Observer observer; @Before @SuppressWarnings("unchecked") public void before() { scheduler = new TestScheduler(); - innerScheduler = scheduler.createInner(); + innerScheduler = scheduler.createWorker(); observer = mock(Observer.class); } diff --git a/rxjava-core/src/test/java/rx/operators/OperationWindowTest.java b/rxjava-core/src/test/java/rx/operators/OperationWindowTest.java index 480b02fdf7..38376a06c9 100644 --- a/rxjava-core/src/test/java/rx/operators/OperationWindowTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperationWindowTest.java @@ -46,12 +46,12 @@ public class OperationWindowTest { private TestScheduler scheduler; - private Scheduler.Inner innerScheduler; + private Scheduler.Worker innerScheduler; @Before public void before() { scheduler = new TestScheduler(); - innerScheduler = scheduler.createInner(); + innerScheduler = scheduler.createWorker(); } private static List> toLists(Observable> observables) { diff --git a/rxjava-core/src/test/java/rx/operators/OperatorAmbTest.java b/rxjava-core/src/test/java/rx/operators/OperatorAmbTest.java index fae9a5d4a6..95ff378b70 100644 --- a/rxjava-core/src/test/java/rx/operators/OperatorAmbTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperatorAmbTest.java @@ -39,12 +39,12 @@ public class OperatorAmbTest { private TestScheduler scheduler; - private Scheduler.Inner innerScheduler; + private Scheduler.Worker innerScheduler; @Before public void setUp() { scheduler = new TestScheduler(); - innerScheduler = scheduler.createInner(); + innerScheduler = scheduler.createWorker(); } private Observable createObservable(final String[] values, diff --git a/rxjava-core/src/test/java/rx/operators/OperatorMergeTest.java b/rxjava-core/src/test/java/rx/operators/OperatorMergeTest.java index 63cefade79..a4d7583d40 100644 --- a/rxjava-core/src/test/java/rx/operators/OperatorMergeTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperatorMergeTest.java @@ -42,7 +42,7 @@ import rx.Observable.OnSubscribe; import rx.Observer; import rx.Scheduler; -import rx.Scheduler.Inner; +import rx.Scheduler.Worker; import rx.Subscriber; import rx.Subscription; import rx.functions.Action0; @@ -485,7 +485,7 @@ public void testConcurrency() { @Override public void call(final Subscriber s) { - Inner inner = Schedulers.newThread().createInner(); + Worker inner = Schedulers.newThread().createWorker(); s.add(inner); inner.schedule(new Action0() { @@ -521,7 +521,7 @@ public void testConcurrencyWithSleeping() { @Override public void call(final Subscriber s) { - Inner inner = Schedulers.newThread().createInner(); + Worker inner = Schedulers.newThread().createWorker(); s.add(inner); inner.schedule(new Action0() { @@ -562,7 +562,7 @@ public void testConcurrencyWithBrokenOnCompleteContract() { @Override public void call(final Subscriber s) { - Inner inner = Schedulers.newThread().createInner(); + Worker inner = Schedulers.newThread().createWorker(); s.add(inner); inner.schedule(new Action0() { diff --git a/rxjava-core/src/test/java/rx/operators/OperatorSubscribeOnTest.java b/rxjava-core/src/test/java/rx/operators/OperatorSubscribeOnTest.java index 1e1977917e..db27182581 100644 --- a/rxjava-core/src/test/java/rx/operators/OperatorSubscribeOnTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperatorSubscribeOnTest.java @@ -94,15 +94,15 @@ public SlowScheduler(Scheduler actual, long delay, TimeUnit unit) { } @Override - public Inner createInner() { - return new SlowInner(actual.createInner()); + public Worker createWorker() { + return new SlowInner(actual.createWorker()); } - private class SlowInner extends Inner { + private class SlowInner extends Worker { - private final Scheduler.Inner actualInner; + private final Scheduler.Worker actualInner; - private SlowInner(Inner actual) { + private SlowInner(Worker actual) { this.actualInner = actual; } diff --git a/rxjava-core/src/test/java/rx/operators/OperatorUnsubscribeOnTest.java b/rxjava-core/src/test/java/rx/operators/OperatorUnsubscribeOnTest.java index 5cb0edb2e4..99281a6841 100644 --- a/rxjava-core/src/test/java/rx/operators/OperatorUnsubscribeOnTest.java +++ b/rxjava-core/src/test/java/rx/operators/OperatorUnsubscribeOnTest.java @@ -138,13 +138,13 @@ public Thread getThread() throws InterruptedException { public static class UIEventLoopScheduler extends Scheduler { - private final Scheduler.Inner eventLoop; + private final Scheduler.Worker eventLoop; private final Subscription s; private volatile Thread t; public UIEventLoopScheduler() { - eventLoop = Schedulers.newThread().createInner(); + eventLoop = Schedulers.newThread().createWorker(); s = eventLoop; /* @@ -168,7 +168,7 @@ public void call() { } @Override - public Inner createInner() { + public Worker createWorker() { return eventLoop; } diff --git a/rxjava-core/src/test/java/rx/schedulers/AbstractSchedulerConcurrencyTests.java b/rxjava-core/src/test/java/rx/schedulers/AbstractSchedulerConcurrencyTests.java index 1eeaa31ac8..332b9c257b 100644 --- a/rxjava-core/src/test/java/rx/schedulers/AbstractSchedulerConcurrencyTests.java +++ b/rxjava-core/src/test/java/rx/schedulers/AbstractSchedulerConcurrencyTests.java @@ -30,7 +30,7 @@ import rx.Observable; import rx.Observable.OnSubscribe; import rx.Scheduler; -import rx.Scheduler.Inner; +import rx.Scheduler.Worker; import rx.Subscriber; import rx.Subscription; import rx.functions.Action0; @@ -100,7 +100,7 @@ public void testUnsubscribeRecursiveScheduleFromOutside() throws InterruptedExce final CountDownLatch latch = new CountDownLatch(1); final CountDownLatch unsubscribeLatch = new CountDownLatch(1); final AtomicInteger counter = new AtomicInteger(); - final Inner inner = getScheduler().createInner(); + final Worker inner = getScheduler().createWorker(); inner.schedule(new Action0() { @@ -145,7 +145,7 @@ public void call() { public void testUnsubscribeRecursiveScheduleFromInside() throws InterruptedException { final CountDownLatch unsubscribeLatch = new CountDownLatch(1); final AtomicInteger counter = new AtomicInteger(); - final Inner inner = getScheduler().createInner(); + final Worker inner = getScheduler().createWorker(); inner.schedule(new Action0() { @Override @@ -179,7 +179,7 @@ public void testUnsubscribeRecursiveScheduleWithDelay() throws InterruptedExcept final CountDownLatch latch = new CountDownLatch(1); final CountDownLatch unsubscribeLatch = new CountDownLatch(1); final AtomicInteger counter = new AtomicInteger(); - final Inner inner = getScheduler().createInner(); + final Worker inner = getScheduler().createWorker(); inner.schedule(new Action0() { @Override @@ -220,7 +220,7 @@ public void call() { @Test public void recursionFromOuterActionAndUnsubscribeInside() throws InterruptedException { final CountDownLatch latch = new CountDownLatch(1); - final Inner inner = getScheduler().createInner(); + final Worker inner = getScheduler().createWorker(); inner.schedule(new Action0() { int i = 0; @@ -245,7 +245,7 @@ public void call() { @Test public void testRecursion() throws InterruptedException { final CountDownLatch latch = new CountDownLatch(1); - final Inner inner = getScheduler().createInner(); + final Worker inner = getScheduler().createWorker(); inner.schedule(new Action0() { private long i = 0; @@ -276,7 +276,7 @@ public void testRecursionAndOuterUnsubscribe() throws InterruptedException { Observable obs = Observable.create(new OnSubscribe() { @Override public void call(final Subscriber observer) { - final Inner inner = getScheduler().createInner(); + final Worker inner = getScheduler().createWorker(); inner.schedule(new Action0() { @Override public void call() { diff --git a/rxjava-core/src/test/java/rx/schedulers/AbstractSchedulerTests.java b/rxjava-core/src/test/java/rx/schedulers/AbstractSchedulerTests.java index 04a3c569f9..a3ff320ad4 100644 --- a/rxjava-core/src/test/java/rx/schedulers/AbstractSchedulerTests.java +++ b/rxjava-core/src/test/java/rx/schedulers/AbstractSchedulerTests.java @@ -61,7 +61,7 @@ public abstract class AbstractSchedulerTests { @Test public void testNestedActions() throws InterruptedException { Scheduler scheduler = getScheduler(); - final Scheduler.Inner inner = scheduler.createInner(); + final Scheduler.Worker inner = scheduler.createWorker(); final CountDownLatch latch = new CountDownLatch(1); final Action0 firstStepStart = mock(Action0.class); @@ -153,7 +153,7 @@ public String call(String s) { @Test public final void testSequenceOfActions() throws InterruptedException { final Scheduler scheduler = getScheduler(); - final Scheduler.Inner inner = scheduler.createInner(); + final Scheduler.Worker inner = scheduler.createWorker(); final CountDownLatch latch = new CountDownLatch(2); final Action0 first = mock(Action0.class); @@ -196,7 +196,7 @@ public Object answer(InvocationOnMock invocation) throws Throwable { @Test public void testSequenceOfDelayedActions() throws InterruptedException { Scheduler scheduler = getScheduler(); - final Scheduler.Inner inner = scheduler.createInner(); + final Scheduler.Worker inner = scheduler.createWorker(); final CountDownLatch latch = new CountDownLatch(1); final Action0 first = mock(Action0.class); @@ -228,7 +228,7 @@ public void call() { @Test public void testMixOfDelayedAndNonDelayedActions() throws InterruptedException { Scheduler scheduler = getScheduler(); - final Scheduler.Inner inner = scheduler.createInner(); + final Scheduler.Worker inner = scheduler.createWorker(); final CountDownLatch latch = new CountDownLatch(1); final Action0 first = mock(Action0.class); @@ -265,7 +265,7 @@ public void call() { @Test public final void testRecursiveExecution() throws InterruptedException { final Scheduler scheduler = getScheduler(); - final Scheduler.Inner inner = scheduler.createInner(); + final Scheduler.Worker inner = scheduler.createWorker(); final AtomicInteger i = new AtomicInteger(); final CountDownLatch latch = new CountDownLatch(1); inner.schedule(new Action0() { @@ -287,7 +287,7 @@ public void call() { @Test public final void testRecursiveExecutionWithDelayTime() throws InterruptedException { Scheduler scheduler = getScheduler(); - final Scheduler.Inner inner = scheduler.createInner(); + final Scheduler.Worker inner = scheduler.createWorker(); final AtomicInteger i = new AtomicInteger(); final CountDownLatch latch = new CountDownLatch(1); @@ -316,7 +316,7 @@ public final void testRecursiveSchedulerInObservable() { Observable obs = Observable.create(new OnSubscribe() { @Override public void call(final Subscriber observer) { - final Scheduler.Inner inner = getScheduler().createInner(); + final Scheduler.Worker inner = getScheduler().createWorker(); observer.add(inner); inner.schedule(new Action0() { int i = 0; diff --git a/rxjava-core/src/test/java/rx/schedulers/ComputationSchedulerTests.java b/rxjava-core/src/test/java/rx/schedulers/ComputationSchedulerTests.java index ef8644950b..7c6a90bf56 100644 --- a/rxjava-core/src/test/java/rx/schedulers/ComputationSchedulerTests.java +++ b/rxjava-core/src/test/java/rx/schedulers/ComputationSchedulerTests.java @@ -45,7 +45,7 @@ public void testThreadSafetyWhenSchedulerIsHoppingBetweenThreads() { final CountDownLatch latch = new CountDownLatch(1); final HashMap map = new HashMap(); - final Scheduler.Inner inner = Schedulers.computation().createInner(); + final Scheduler.Worker inner = Schedulers.computation().createWorker(); inner.schedule(new Action0() { diff --git a/rxjava-core/src/test/java/rx/schedulers/TestSchedulerTest.java b/rxjava-core/src/test/java/rx/schedulers/TestSchedulerTest.java index 846340a88a..81ba34ab62 100644 --- a/rxjava-core/src/test/java/rx/schedulers/TestSchedulerTest.java +++ b/rxjava-core/src/test/java/rx/schedulers/TestSchedulerTest.java @@ -42,7 +42,7 @@ public final void testPeriodicScheduling() { final Func1 calledOp = mock(Func1.class); final TestScheduler scheduler = new TestScheduler(); - final Scheduler.Inner inner = scheduler.createInner(); + final Scheduler.Worker inner = scheduler.createWorker(); inner.schedulePeriodically(new Action0() { @Override @@ -80,7 +80,7 @@ public void call() { @Test public final void testImmediateUnsubscribes() { TestScheduler s = new TestScheduler(); - final Scheduler.Inner inner = s.createInner(); + final Scheduler.Worker inner = s.createWorker(); final AtomicInteger counter = new AtomicInteger(0); inner.schedule(new Action0() { diff --git a/rxjava-core/src/test/java/rx/test/OperatorTester.java b/rxjava-core/src/test/java/rx/test/OperatorTester.java index 3069e5e5ec..218519286b 100644 --- a/rxjava-core/src/test/java/rx/test/OperatorTester.java +++ b/rxjava-core/src/test/java/rx/test/OperatorTester.java @@ -52,8 +52,8 @@ public ForwardingScheduler(Scheduler underlying) { } @Override - public Inner createInner() { - return underlying.createInner(); + public Worker createWorker() { + return underlying.createWorker(); } }