package org.mercury_im.messenger.data.di;

import org.mercury_im.messenger.util.ThreadUtils;

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

import dagger.Module;
import dagger.Provides;
import io.reactivex.Scheduler;
import io.reactivex.schedulers.Schedulers;

@Module
public class TestingSchedulerModule {

    @Provides
    @Singleton
    @Named(value = ThreadUtils.SCHEDULER_IO)
    public static Scheduler provideSubscriberScheduler() {
        return Schedulers.io();
    }

    @Provides
    @Singleton
    @Named(value = ThreadUtils.SCHEDULER_UI)
    public static Scheduler provideObserverScheduler() {
        return Schedulers.trampoline();
    }
}
