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


Java ReplaySubject.createWithTime方法代码示例

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


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

示例1: testReplaySubjectLimit

import rx.subjects.ReplaySubject; //导入方法依赖的package包/类
public void testReplaySubjectLimit() throws Exception {
    ReplaySubject<Integer> replaySubject =/* ReplaySubject.createWithSize(2);*/
            ReplaySubject.createWithTime(150, TimeUnit.MICROSECONDS, Schedulers.immediate());
    replaySubject.onNext(0);
    Thread.sleep(100);
    replaySubject.onNext(1);
    Thread.sleep(100);
    replaySubject.onNext(2);
    replaySubject.subscribe(new SubAction("Later: "));
    replaySubject.onNext(3);
}
 
开发者ID:yeungeek,项目名称:Android-Gradle-Samples,代码行数:12,代码来源:SubjectTest.java

示例2: RxBus

import rx.subjects.ReplaySubject; //导入方法依赖的package包/类
/**
 * With this constructor the {@link RxBus} use a {@link ReplaySubject} and instantiate it calling the static method  {@code ReplaySubject.createWithTime(retainTime, timeUnit, scheduler)}
 * @see ReplaySubject
 * @param retainTime events retain time, passed to {@link ReplaySubject}
 * @param timeUnit events retain time unit, passed to {@link ReplaySubject}
 * @param scheduler events retain time scheduler, passed to {@link ReplaySubject}
 */
public RxBus(int retainTime, TimeUnit timeUnit, Scheduler scheduler) {
    super((Subject<T, R>) ReplaySubject.createWithTime(retainTime, timeUnit, scheduler));
    mSubscriptionsList = new WeakHashMap<>();
}
 
开发者ID:SysdataSpA,项目名称:UniversalEventBus,代码行数:12,代码来源:RxBus.java

示例3: HystrixCluster

import rx.subjects.ReplaySubject; //导入方法依赖的package包/类
/**
 * Creates a new cluster
 *
 * @param name                 The name of the cluster
 * @param maxTrafficTtlSeconds How many seconds back in the future we should consider max traffic
 */
public HystrixCluster(String name, int maxTrafficTtlSeconds)
{
    this.name = name;
    this.maxSubject = ReplaySubject.createWithTime(maxTrafficTtlSeconds, TimeUnit.SECONDS, Schedulers.computation());
}
 
开发者ID:OskarKjellin,项目名称:vizceral-hystrix,代码行数:12,代码来源:HystrixCluster.java


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