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


Java Functions.EMPTY_RUNNABLE属性代码示例

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


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

示例1: setFutureRace2

@Test
public void setFutureRace2() {
    final Scheduler s = new ParallelScheduler(2, true);
    try {
        for (int i = 0; i < 1000; i++) {
            final CompositeDisposable cd = new CompositeDisposable();
            final TrackedAction tt = new TrackedAction(this, cd);
            final FutureTask<Object> ft = new FutureTask<Object>(Functions.EMPTY_RUNNABLE, null);

            Runnable r1 = new Runnable() {
                @Override
                public void run() {
                    tt.setFuture(ft);
                }
            };

            Runnable r2 = new Runnable() {
                @Override
                public void run() {
                    tt.future.set(TrackedAction.FINISHED);
                }
            };
            TestHelper.race(r1, r2, Schedulers.single());
        }
    } finally {
        s.shutdown();
    }
}
 
开发者ID:akarnokd,项目名称:RxJava2Extensions,代码行数:28,代码来源:ParallelSchedulerTest.java

示例2: setFutureRace3

@Test
public void setFutureRace3() {
    final Scheduler s = new ParallelScheduler(2, true);
    try {
        for (int i = 0; i < 1000; i++) {
            final CompositeDisposable cd = new CompositeDisposable();
            final TrackedAction tt = new TrackedAction(this, cd);
            final FutureTask<Object> ft = new FutureTask<Object>(Functions.EMPTY_RUNNABLE, null);

            Runnable r1 = new Runnable() {
                @Override
                public void run() {
                    tt.setFuture(ft);
                }
            };

            Runnable r2 = new Runnable() {
                @Override
                public void run() {
                    tt.future.set(TrackedAction.DISPOSED);
                }
            };
            TestHelper.race(r1, r2, Schedulers.single());
        }
    } finally {
        s.shutdown();
    }
}
 
开发者ID:akarnokd,项目名称:RxJava2Extensions,代码行数:28,代码来源:ParallelSchedulerTest.java

示例3: fromFuture

@Test
public void fromFuture() {
    FutureTask<Integer> ft = new FutureTask<Integer>(Functions.EMPTY_RUNNABLE, 1);
    ft.run();

    Perhaps.fromFuture(ft)
    .test()
    .assertResult(1);
}
 
开发者ID:akarnokd,项目名称:RxJava2Extensions,代码行数:9,代码来源:PerhapsTest.java

示例4: fromFutureNull

@Test
public void fromFutureNull() {
    FutureTask<Integer> ft = new FutureTask<Integer>(Functions.EMPTY_RUNNABLE, null);
    ft.run();

    Perhaps.fromFuture(ft)
    .test()
    .assertResult();
}
 
开发者ID:akarnokd,项目名称:RxJava2Extensions,代码行数:9,代码来源:PerhapsTest.java

示例5: fromFutureTimeout

@Test
public void fromFutureTimeout() {
    FutureTask<Integer> ft = new FutureTask<Integer>(Functions.EMPTY_RUNNABLE, 1);

    Perhaps.fromFuture(ft, 1, TimeUnit.MILLISECONDS)
    .test()
    .assertFailure(TimeoutException.class);
}
 
开发者ID:akarnokd,项目名称:RxJava2Extensions,代码行数:8,代码来源:PerhapsTest.java

示例6: fromFuture

@Test
public void fromFuture() {
    FutureTask<Integer> ft = new FutureTask<Integer>(Functions.EMPTY_RUNNABLE, 1);
    ft.run();

    Solo.fromFuture(ft)
    .test()
    .assertResult(1);
}
 
开发者ID:akarnokd,项目名称:RxJava2Extensions,代码行数:9,代码来源:SoloTest.java

示例7: fromFutureNull

@Test
public void fromFutureNull() {
    FutureTask<Integer> ft = new FutureTask<Integer>(Functions.EMPTY_RUNNABLE, null);
    ft.run();

    Solo.fromFuture(ft)
    .test()
    .assertFailure(NoSuchElementException.class);
}
 
开发者ID:akarnokd,项目名称:RxJava2Extensions,代码行数:9,代码来源:SoloTest.java

示例8: fromFutureTimeout

@Test
public void fromFutureTimeout() {
    FutureTask<Integer> ft = new FutureTask<Integer>(Functions.EMPTY_RUNNABLE, 1);

    Solo.fromFuture(ft, 1, TimeUnit.MILLISECONDS)
    .test()
    .assertFailure(TimeoutException.class);
}
 
开发者ID:akarnokd,项目名称:RxJava2Extensions,代码行数:8,代码来源:SoloTest.java

示例9: startFuture

@Test
public void startFuture() {
    final FutureTask<Integer> ft = new FutureTask<Integer>(Functions.EMPTY_RUNNABLE, 1);
    ft.run();
    AsyncFlowable.startFuture(new Callable<Future<Integer>>() {
        @Override
        public Future<Integer> call() throws Exception {
            return ft;
        }
    })
    .test()
    .awaitDone(5, TimeUnit.SECONDS)
    .assertResult(1);
}
 
开发者ID:akarnokd,项目名称:RxJava2Extensions,代码行数:14,代码来源:AsyncFlowableTest.java

示例10: startFutureNull

@Test
public void startFutureNull() {
    final FutureTask<Integer> ft = new FutureTask<Integer>(Functions.EMPTY_RUNNABLE, null);
    ft.run();
    AsyncFlowable.startFuture(new Callable<Future<Integer>>() {
        @Override
        public Future<Integer> call() throws Exception {
            return ft;
        }
    })
    .test()
    .awaitDone(5, TimeUnit.SECONDS)
    .assertResult();
}
 
开发者ID:akarnokd,项目名称:RxJava2Extensions,代码行数:14,代码来源:AsyncFlowableTest.java

示例11: startFutureCustomScheduler

@Test
public void startFutureCustomScheduler() {
    final FutureTask<Integer> ft = new FutureTask<Integer>(Functions.EMPTY_RUNNABLE, 1);
    ft.run();
    AsyncFlowable.startFuture(new Callable<Future<Integer>>() {
        @Override
        public Future<Integer> call() throws Exception {
            return ft;
        }
    }, Schedulers.single())
    .test()
    .awaitDone(5, TimeUnit.SECONDS)
    .assertResult(1);
}
 
开发者ID:akarnokd,项目名称:RxJava2Extensions,代码行数:14,代码来源:AsyncFlowableTest.java

示例12: deferFuture

@Test
public void deferFuture() {
    final FutureTask<Flowable<Integer>> ft = new FutureTask<Flowable<Integer>>(Functions.EMPTY_RUNNABLE, Flowable.just(1));
    ft.run();

    AsyncFlowable.deferFuture(new Callable<Future<Flowable<Integer>>>() {
        @Override
        public Future<Flowable<Integer>> call() throws Exception {
            return ft;
        }
    })
    .test()
    .awaitDone(5, TimeUnit.SECONDS)
    .assertResult(1);
}
 
开发者ID:akarnokd,项目名称:RxJava2Extensions,代码行数:15,代码来源:AsyncFlowableTest.java

示例13: deferFutureCustomScheduler

@Test
public void deferFutureCustomScheduler() {
    final FutureTask<Flowable<Integer>> ft = new FutureTask<Flowable<Integer>>(Functions.EMPTY_RUNNABLE, Flowable.just(1));
    ft.run();

    AsyncFlowable.deferFuture(new Callable<Future<Flowable<Integer>>>() {
        @Override
        public Future<Flowable<Integer>> call() throws Exception {
            return ft;
        }
    }, Schedulers.single())
    .test()
    .awaitDone(5, TimeUnit.SECONDS)
    .assertResult(1);
}
 
开发者ID:akarnokd,项目名称:RxJava2Extensions,代码行数:15,代码来源:AsyncFlowableTest.java

示例14: startFuture

@Test
public void startFuture() {
    final FutureTask<Integer> ft = new FutureTask<Integer>(Functions.EMPTY_RUNNABLE, 1);
    ft.run();
    AsyncObservable.startFuture(new Callable<Future<Integer>>() {
        @Override
        public Future<Integer> call() throws Exception {
            return ft;
        }
    })
    .test()
    .awaitDone(5, TimeUnit.SECONDS)
    .assertResult(1);
}
 
开发者ID:akarnokd,项目名称:RxJava2Extensions,代码行数:14,代码来源:AsyncObservableTest.java

示例15: startFutureNull

@Test
public void startFutureNull() {
    final FutureTask<Integer> ft = new FutureTask<Integer>(Functions.EMPTY_RUNNABLE, null);
    ft.run();
    AsyncObservable.startFuture(new Callable<Future<Integer>>() {
        @Override
        public Future<Integer> call() throws Exception {
            return ft;
        }
    })
    .test()
    .awaitDone(5, TimeUnit.SECONDS)
    .assertResult();
}
 
开发者ID:akarnokd,项目名称:RxJava2Extensions,代码行数:14,代码来源:AsyncObservableTest.java


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