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


PHP onNext函数代码示例

本文整理汇总了PHP中onNext函数的典型用法代码示例。如果您正苦于以下问题:PHP onNext函数的具体用法?PHP onNext怎么用?PHP onNext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: interval_relative_time_Negative

 /**
  * @test
  */
 public function interval_relative_time_Negative()
 {
     $results = $this->scheduler->startWithDispose(function () {
         return new IntervalObservable(-1, $this->scheduler);
     }, 210);
     $this->assertMessages([onNext(201, 0), onNext(202, 1), onNext(203, 2), onNext(204, 3), onNext(205, 4), onNext(206, 5), onNext(207, 6), onNext(208, 7), onNext(209, 8)], $results->getMessages());
 }
开发者ID:voryx,项目名称:Rx.PHP,代码行数:10,代码来源:IntervalObservableTest.php

示例2: range_dispose

 /**
  * @test
  */
 public function range_dispose()
 {
     $results = $this->scheduler->startWithDispose(function () {
         return Observable::range(-10, 5, $this->scheduler);
     }, 204);
     $this->assertMessages([onNext(201, -10), onNext(202, -9), onNext(203, -8)], $results->getMessages());
 }
开发者ID:ReactiveX,项目名称:RxPHP,代码行数:10,代码来源:RangeTest.php

示例3: timer_one_shot_relative_time_negative

 /**
  * @test
  */
 public function timer_one_shot_relative_time_negative()
 {
     $results = $this->scheduler->startWithCreate(function () {
         return new TimerObservable(-1, $this->scheduler);
     });
     $this->assertMessages([onNext(201, 0), onCompleted(201)], $results->getMessages());
 }
开发者ID:ReactiveX,项目名称:RxPHP,代码行数:10,代码来源:TimerObservableTest.php

示例4: fromArray_dispose

 /**
  * @test
  */
 public function fromArray_dispose()
 {
     $xs = Observable::fromArray(['foo', 'bar', 'baz']);
     $results = $this->scheduler->startWithDispose(function () use($xs) {
         return $xs;
     }, 202);
     $this->assertMessages([onNext(201, 'foo')], $results->getMessages());
 }
开发者ID:voryx,项目名称:Rx.PHP,代码行数:11,代码来源:FromArrayTest.php

示例5: switchLatest_Dispose

 /**
  * @test
  */
 public function switchLatest_Dispose()
 {
     $xs = $this->createHotObservable([onNext(300, $this->createColdObservable([onNext(10, 101), onNext(20, 102), onNext(110, 103), onNext(120, 104), onNext(210, 105), onNext(220, 106), onCompleted(230)])), onNext(400, $this->createColdObservable([onNext(10, 201), onNext(20, 202), onNext(30, 203), onNext(40, 204), onCompleted(50)])), onNext(500, $this->createColdObservable([onNext(10, 301), onNext(20, 302), onNext(30, 303), onNext(40, 304), onCompleted(150)])), onCompleted(600)]);
     $results = $this->scheduler->startWithDispose(function () use($xs) {
         return $xs->switchLatest();
     }, 500);
     $this->assertMessages([onNext(310, 101), onNext(320, 102), onNext(410, 201), onNext(420, 202), onNext(430, 203), onNext(440, 204)], $results->getMessages());
 }
开发者ID:ReactiveX,项目名称:RxPHP,代码行数:11,代码来源:SwitchLatestTest.php

示例6: sum_number_never

 /**
  * Adapted from RxJS
  *
  * @test
  */
 public function sum_number_never()
 {
     $xs = $this->createHotObservable([onNext(150, 1)]);
     $results = $this->scheduler->startWithCreate(function () use($xs) {
         return $xs->sum();
     });
     $this->assertMessages([], $results->getMessages());
 }
开发者ID:ReactiveX,项目名称:RxPHP,代码行数:13,代码来源:SumTest.php

示例7: timestamp_dispose

 /**
  * @test
  */
 public function timestamp_dispose()
 {
     $xs = $this->createHotObservable([onNext(150, 1), onNext(210, 2), onNext(230, 3), onNext(260, 4), onNext(300, 5), onNext(350, 6), onCompleted(400)]);
     $results = $this->scheduler->startWithDispose(function () use($xs) {
         return $xs->timestamp($this->scheduler);
     }, 275);
     $this->assertMessages([onNext(210, new Timestamped(210, 2)), onNext(230, new Timestamped(230, 3)), onNext(260, new Timestamped(260, 4))], $results->getMessages());
 }
开发者ID:ReactiveX,项目名称:RxPHP,代码行数:11,代码来源:TimestampTest.php

示例8: it_schedules_all_elements_from_the_array

 /**
  * @test
  */
 public function it_schedules_all_elements_from_the_array()
 {
     $xs = BaseObservable::fromArray(array('foo', 'bar', 'baz'), $this->scheduler);
     $results = $this->scheduler->startWithCreate(function () use($xs) {
         return $xs;
     });
     $this->assertCount(4, $results->getMessages());
     $this->assertMessages(array(onNext(201, 'foo'), onNext(202, 'bar'), onNext(203, 'baz'), onCompleted(204)), $results->getMessages());
 }
开发者ID:bluetechy,项目名称:Rx.PHP,代码行数:12,代码来源:FromArrayTest.php

示例9: startWith_error

 /**
  * @test
  */
 public function startWith_error()
 {
     $error = new \Exception();
     $xs = $this->createHotObservable([onNext(150, 1), onError(250, $error)]);
     $results = $this->scheduler->startWithCreate(function () use($xs) {
         return $xs->startWithArray([1, 2, 3]);
     });
     $this->assertMessages([onNext(201, 1), onNext(202, 2), onNext(203, 3), onError(250, $error)], $results->getMessages());
 }
开发者ID:ReactiveX,项目名称:RxPHP,代码行数:12,代码来源:StartWithTest.php

示例10: pluck_array_numeric_index

 /**
  * @test
  */
 public function pluck_array_numeric_index()
 {
     $xs = $this->createHotObservable([onNext(180, [-1, -1, -1, -1]), onNext(210, [4, 3, 2, 1]), onNext(240, [4, 3, 20, 10]), onNext(290, [4, 3, 200, 100]), onNext(350, [4, 3, 2000, 1000]), onCompleted(400)]);
     $results = $this->scheduler->startWithCreate(function () use($xs) {
         return $xs->pluck(2);
     });
     $this->assertMessages([onNext(210, 2), onNext(240, 20), onNext(290, 200), onNext(350, 2000), onCompleted(400)], $results->getMessages());
     $this->assertSubscriptions([subscribe(200, 400)], $xs->getSubscriptions());
 }
开发者ID:ReactiveX,项目名称:RxPHP,代码行数:12,代码来源:PluckTest.php

示例11: subscribeOn_never

 /**
  * @test
  */
 public function subscribeOn_never()
 {
     $xs = $this->createHotObservable([onNext(150, 1)]);
     $results = $this->scheduler->startWithCreate(function () use($xs) {
         return $xs->subscribeOn($this->scheduler);
     });
     $this->assertMessages([], $results->getMessages());
     $this->assertSubscriptions([subscribe(201, 1001)], $xs->getSubscriptions());
 }
开发者ID:voryx,项目名称:Rx.PHP,代码行数:12,代码来源:SubscribeOnTest.php

示例12: it_skips_multiple_values

 /**
  * @test
  */
 public function it_skips_multiple_values()
 {
     $scheduler = $this->createTestScheduler();
     $xs = $this->createHotObservable(array(onNext(300, 21), onNext(500, 42), onNext(800, 84), onNext(850, 168), onCompleted(870)));
     $results = $this->scheduler->startWithCreate(function () use($xs) {
         return $xs->skip(2);
     });
     $this->assertMessages(array(onNext(800, 84), onNext(850, 168), onCompleted(870)), $results->getMessages());
 }
开发者ID:bluetechy,项目名称:Rx.PHP,代码行数:12,代码来源:SkipTest.php

示例13: start_action_number

 /**
  * @test
  */
 public function start_action_number()
 {
     $results = $this->scheduler->startWithCreate(function () {
         return Observable::start(function () {
             return 1;
         }, $this->scheduler);
     });
     $this->assertMessages([onNext(200, 1), onCompleted(200)], $results->getMessages());
 }
开发者ID:voryx,项目名称:Rx.PHP,代码行数:12,代码来源:StartTest.php

示例14: take_zero_calls_on_completed

 /**
  * @test
  */
 public function take_zero_calls_on_completed()
 {
     $scheduler = $this->createTestScheduler();
     $xs = $this->createHotObservable(array(onNext(300, 21), onNext(500, 42), onNext(800, 84), onCompleted(820)));
     $results = $this->scheduler->startWithCreate(function () use($xs) {
         return $xs->take(0);
     });
     $this->assertMessages(array(onCompleted(201)), $results->getMessages());
 }
开发者ID:Gasperowicz,项目名称:Rx.PHP,代码行数:12,代码来源:TakeTest.php

示例15: testToArrayDisposed

 public function testToArrayDisposed()
 {
     $xs = $this->createHotObservable([onNext(110, 1), onNext(220, 2), onNext(330, 3), onNext(440, 4), onNext(550, 5)]);
     $results = $this->scheduler->startWithCreate(function () use($xs) {
         return $xs->toArray();
     });
     $this->assertMessages([], $results->getMessages());
     $this->assertSubscriptions([subscribe(200, 1000)], $xs->getSubscriptions());
 }
开发者ID:bluetechy,项目名称:Rx.PHP,代码行数:9,代码来源:ToArrayTest.php


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