当前位置: 首页>>代码示例>>Java>>正文


Java Schedulers.trampoline方法代码示例

本文整理汇总了Java中io.reactivex.schedulers.Schedulers.trampoline方法的典型用法代码示例。如果您正苦于以下问题:Java Schedulers.trampoline方法的具体用法?Java Schedulers.trampoline怎么用?Java Schedulers.trampoline使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.reactivex.schedulers.Schedulers的用法示例。


在下文中一共展示了Schedulers.trampoline方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: postToObservable

import io.reactivex.schedulers.Schedulers; //导入方法依赖的package包/类
/**
 * 用于处理订阅事件在那个线程中执行
 *
 * @param observable       d
 * @param subscriberMethod d
 * @return Observable
 */
private Flowable postToObservable(Flowable observable, SubscriberMethod subscriberMethod) {
    Scheduler scheduler;
    switch (subscriberMethod.threadMode) {
        case MAIN:
            scheduler = AndroidSchedulers.mainThread();
            break;

        case NEW_THREAD:
            scheduler = Schedulers.newThread();
            break;

        case CURRENT_THREAD:
            scheduler = Schedulers.trampoline();
            break;
        default:
            throw new IllegalStateException("Unknown thread mode: " + subscriberMethod.threadMode);
    }
    return observable.observeOn(scheduler);
}
 
开发者ID:Horrarndoo,项目名称:YiZhi,代码行数:27,代码来源:RxBus.java

示例2: beforeEachTest

import io.reactivex.schedulers.Schedulers; //导入方法依赖的package包/类
@Before public void beforeEachTest() {
    MockitoAnnotations.initMocks(this);
    Scheduler uiScheduler = Schedulers.trampoline();

    view = new FakeDisplayFactsView(onNext, onError, onCompleted);

    BehavioursCoordinator<FactAboutNumber> coordinator = new BehavioursCoordinator<>(
            new AssignEmptyState<>(view, uiScheduler),
            new AssignErrorState<>(view, uiScheduler),
            new LoadingCoordination<>(view, uiScheduler),
            new NetworkingErrorFeedback<>(view, uiScheduler),
            new RefreshToogle<>(view, uiScheduler)
    );

    presenter = new FactsPresenter(
            usecase,
            view,
            coordinator,
            strategist,
            domainData -> new NumberAndFact(domainData.number, domainData.fact)
    );
}
 
开发者ID:ubiratansoares,项目名称:reactive-architectures-playground,代码行数:23,代码来源:FactsPresenterTests.java

示例3: getInitMainThreadSchedulerHandlerReturnsHandler

import io.reactivex.schedulers.Schedulers; //导入方法依赖的package包/类
@Test
public void getInitMainThreadSchedulerHandlerReturnsHandler() {
    Function<Callable<Scheduler>, Scheduler> handler = new Function<Callable<Scheduler>, Scheduler>() {
        @Override public Scheduler apply(Callable<Scheduler> schedulerCallable) throws Exception {
            return Schedulers.trampoline();
        }
    };
    RxAndroidPlugins.setInitMainThreadSchedulerHandler(handler);
    assertSame(handler, RxAndroidPlugins.getInitMainThreadSchedulerHandler());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:RxAndroidPluginsTest.java

示例4: getMainThreadSchedulerHandlerReturnsHandler

import io.reactivex.schedulers.Schedulers; //导入方法依赖的package包/类
@Test
public void getMainThreadSchedulerHandlerReturnsHandler() {
    Function<Scheduler, Scheduler> handler = new Function<Scheduler, Scheduler>() {
        @Override public Scheduler apply(Scheduler scheduler) {
            return Schedulers.trampoline();
        }
    };
    RxAndroidPlugins.setMainThreadSchedulerHandler(handler);
    assertSame(handler, RxAndroidPlugins.getOnMainThreadSchedulerHandler());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:RxAndroidPluginsTest.java

示例5: getInitMainThreadSchedulerHandlerReturnsHandler

import io.reactivex.schedulers.Schedulers; //导入方法依赖的package包/类
@Test
public void getInitMainThreadSchedulerHandlerReturnsHandler() {
	Function<Callable<Scheduler>, Scheduler> handler = new Function<Callable<Scheduler>, Scheduler>() {
		@Override
		public Scheduler apply(Callable<Scheduler> schedulerCallable) throws Exception {
			return Schedulers.trampoline();
		}
	};
	RxSwtPlugins.setInitMainThreadSchedulerHandler(handler);
	assertSame(handler, RxSwtPlugins.getInitMainThreadSchedulerHandler());
}
 
开发者ID:SimonScholz,项目名称:RxSWT,代码行数:12,代码来源:RxSwtPluginsTest.java

示例6: getMainThreadSchedulerHandlerReturnsHandler

import io.reactivex.schedulers.Schedulers; //导入方法依赖的package包/类
@Test
public void getMainThreadSchedulerHandlerReturnsHandler() {
	Function<Scheduler, Scheduler> handler = new Function<Scheduler, Scheduler>() {
		@Override
		public Scheduler apply(Scheduler scheduler) {
			return Schedulers.trampoline();
		}
	};
	RxSwtPlugins.setMainThreadSchedulerHandler(handler);
	assertSame(handler, RxSwtPlugins.getOnMainThreadSchedulerHandler());
}
 
开发者ID:SimonScholz,项目名称:RxSWT,代码行数:12,代码来源:RxSwtPluginsTest.java

示例7: io

import io.reactivex.schedulers.Schedulers; //导入方法依赖的package包/类
@Override
public Scheduler io() {
    return Schedulers.trampoline();
}
 
开发者ID:BracketCove,项目名称:PosTrainer,代码行数:5,代码来源:SchedulerProvider.java

示例8: io

import io.reactivex.schedulers.Schedulers; //导入方法依赖的package包/类
@NonNull
@Override
public Scheduler io() {
    return Schedulers.trampoline();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:ImmediateSchedulerProvider.java

示例9: ui

import io.reactivex.schedulers.Schedulers; //导入方法依赖的package包/类
@Override
public Scheduler ui() {
    return Schedulers.trampoline();
}
 
开发者ID:BracketCove,项目名称:PosTrainer,代码行数:5,代码来源:SchedulerProvider.java

示例10: trampoline

import io.reactivex.schedulers.Schedulers; //导入方法依赖的package包/类
@Override
public Scheduler trampoline()
{
    return Schedulers.trampoline();
}
 
开发者ID:jbmlaird,项目名称:DiscogsBrowser,代码行数:6,代码来源:MySchedulerProvider.java

示例11: setUp

import io.reactivex.schedulers.Schedulers; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    messageViewModel = new MessageViewModel(messageRepository, messageCache, userResolver, urlResolver);
    sendScheduler = Schedulers.trampoline();
}
 
开发者ID:charafau,项目名称:TurboChat,代码行数:7,代码来源:MessageViewModelTest.java

示例12: ui

import io.reactivex.schedulers.Schedulers; //导入方法依赖的package包/类
@NonNull
@Override
public Scheduler ui() {
    return Schedulers.trampoline();
}
 
开发者ID:h4h13,项目名称:RetroMusicPlayer,代码行数:6,代码来源:ImmediateScheduler.java

示例13: getScheduler

import io.reactivex.schedulers.Schedulers; //导入方法依赖的package包/类
public Scheduler getScheduler() {
    return Schedulers.trampoline();
}
 
开发者ID:sztomek,项目名称:cleanarchitecture-unidirectional,代码行数:4,代码来源:RxSchedulersOverrideRule.java

示例14: multi

import io.reactivex.schedulers.Schedulers; //导入方法依赖的package包/类
@NonNull
@Override
public Scheduler multi() {
    return Schedulers.trampoline();
}
 
开发者ID:vpaliyX,项目名称:Melophile,代码行数:6,代码来源:TrampolineSchedulerProvider.java

示例15: computation

import io.reactivex.schedulers.Schedulers; //导入方法依赖的package包/类
@NonNull
@Override
public Scheduler computation() {
    return Schedulers.trampoline();
}
 
开发者ID:vpaliyX,项目名称:Melophile,代码行数:6,代码来源:TrampolineSchedulerProvider.java


注:本文中的io.reactivex.schedulers.Schedulers.trampoline方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。