package meta.module.modules;


import android.support.annotation.NonNull;

import javax.inject.Named;
import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;
import io.explod.testable.module.modules.SchedulerModule;
import io.reactivex.Scheduler;
import io.reactivex.internal.schedulers.ExecutorScheduler;

@Module
public class TestSchedulerModule {

	private static class ImmediateScheduler extends Scheduler{
		@NonNull
		@Override
		public Worker createWorker() {
			return new ExecutorScheduler.ExecutorWorker(Runnable::run);
		}
	}

	@NonNull
	@Singleton
	@Provides
	@Named(SchedulerModule.ASYNC_QUERY_SCHEDULER)
	Scheduler providesAsyncQueryScheduler() {
		return new ImmediateScheduler();
	}
}

@@ -424,18 +424,19 @@
 cheduler
+ 
 %7B%0A
-
 %09%09@NonNu
@@ -554,16 +554,106 @@
 %09%09%7D%0A%09%7D%0A%0A
+%09private static final ImmediateScheduler sImmediateScheduler = new ImmediateScheduler();%0A%0A
 %09@NonNul
@@ -776,20 +776,17 @@
 %09return 
-new 
+s
 Immediat
@@ -799,13 +799,12 @@
 uler
-()
 ;%0A%09%7D%0A
+%0A
 %7D%0A

use static instance of immediate scheduler for the schedulermodule