本文整理汇总了Java中rx.schedulers.Schedulers.immediate方法的典型用法代码示例。如果您正苦于以下问题:Java Schedulers.immediate方法的具体用法?Java Schedulers.immediate怎么用?Java Schedulers.immediate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rx.schedulers.Schedulers
的用法示例。
在下文中一共展示了Schedulers.immediate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fetchErrorShouldReturnErrorToView
import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Test
public void fetchErrorShouldReturnErrorToView() {
Exception exception = new Exception();
when(charactersDataSource.getCharacters())
.thenReturn(Observable.<CharactersResponseModel>error(exception));
MainPresenter mainPresenter = new MainPresenter(
this.charactersDataSource,
Schedulers.immediate(),
Schedulers.immediate(),
this.view
);
mainPresenter.loadData();
InOrder inOrder = Mockito.inOrder(view);
inOrder.verify(view, times(1)).onFetchDataStarted();
inOrder.verify(view, times(1)).onFetchDataError(exception);
verify(view, never()).onFetchDataCompleted();
}
示例2: init
import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Before
public void init() {
useCaseExecutor = new UseCaseExecutor() {
@Override
public Scheduler getScheduler() {
return Schedulers.immediate();
}
};
postExecutionThread = new PostExecutionThread() {
@Override
public Scheduler getScheduler() {
return Schedulers.immediate();
}
};
}
示例3: startImmediate
import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Test
public void startImmediate() {
RxState<Integer> state = new RxState<>(0, Schedulers.immediate());
TestSubscriber<Integer> subscriber = new TestSubscriber<>();
state.values(StartWith.IMMEDIATE).subscribe(subscriber);
subscriber.assertValues(0);
state.apply(it -> it + 1);
subscriber.assertValues(0, 1);
}
示例4: startNo
import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Test
public void startNo() {
RxState<Integer> state = new RxState<>(0, Schedulers.immediate());
TestSubscriber<Integer> subscriber = new TestSubscriber<>();
state.values(StartWith.NO).subscribe(subscriber);
subscriber.assertValues();
state.apply(it -> it + 1);
subscriber.assertValues(1);
}
示例5: simplePrint
import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Test
public void simplePrint() throws Exception {
RxState<Integer> state = new RxState<>(0, Schedulers.immediate());
state.values(StartWith.SCHEDULE)
.subscribe(it -> System.out.println(it));
state.apply(it -> it + 1);
}
示例6: setUp
import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
userSearchPresenter = new UserSearchPresenter(userRepository, Schedulers.immediate(),
Schedulers.immediate());
userSearchPresenter.attachView(view);
}
示例7: setUp
import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
makeUpSearchPresenter = new MakeUpSearchPresenter(makeUpRepository, Schedulers.immediate
(), Schedulers.immediate());
makeUpSearchPresenter.attachView(view);
}
示例8: getNewThreadScheduler
import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Override
public Scheduler getNewThreadScheduler(){
return Schedulers.immediate();
}
示例9: setUp
import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Before
public void setUp() {
mMockHackerNewsService = mock(HackerNewsService.class);
mDataManager = new DataManager(mMockHackerNewsService, Schedulers.immediate());
}
示例10: getMainTrheadeScheduler
import rx.schedulers.Schedulers; //导入方法依赖的package包/类
public Scheduler getMainTrheadeScheduler(){
return Schedulers.immediate();
}
示例11: getIOScheduler
import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Override
public Scheduler getIOScheduler() {
return Schedulers.immediate();
}
示例12: OperatorTimeoutWithSelector
import rx.schedulers.Schedulers; //导入方法依赖的package包/类
public OperatorTimeoutWithSelector(Func0<? extends Observable<U>> firstTimeoutSelector, Func1<? super T, ? extends Observable<V>> timeoutSelector, Observable<? extends T> other) {
super(new AnonymousClass1(firstTimeoutSelector), new AnonymousClass2(timeoutSelector), other, Schedulers.immediate());
}
示例13: provideSubscribeScheduler
import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Provides
@PerDataManager
Scheduler provideSubscribeScheduler() {
return Schedulers.immediate();
}
示例14: getMainThreadScheduler
import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Override
public Scheduler getMainThreadScheduler() {
return Schedulers.immediate();
}
示例15: setUp
import rx.schedulers.Schedulers; //导入方法依赖的package包/类
@Before public void setUp() {
RvtsPrime rvtsPrime = new RvtsPrime();
advanceManager =
new AdvanceManager(transport, new MemoryDBManager(), Schedulers.immediate(), rvtsPrime);
}