Examples of RxTimer


Examples of io.vertx.rxcore.java.timer.RxTimer

 
  /** Create RxVertx from Core */
  public RxVertx(Vertx vertx) {
    this.core=vertx;
    this.eventBus=new RxEventBus(core.eventBus());
    this.timer=new RxTimer(core);
  }
View Full Code Here

Examples of io.vertx.rxcore.java.timer.RxTimer

*/
public class TimerIntegrationTest extends TestVerticle {

  @Test
  public void testSetTimer() {
    RxTimer timer=new RxTimer(vertx);
   
    Observable<Long> ob=timer.setTimer(50);
   
    // Wait for 1 element to complete Observable
    assertCountThenComplete(ob,1);
  }
View Full Code Here

Examples of io.vertx.rxcore.java.timer.RxTimer

    assertCountThenComplete(ob,1);
  }
 
  @Test
  public void testSetTimerButCancel() {
    RxTimer timer=new RxTimer(vertx);
   
    Observable<Long> ob=timer.setTimer(50);

    // Subscription that expects 0 elements
    Subscription sub=assertCountThenComplete(ob,0);
   
    // Cancel via unsubscribe should complete empty
View Full Code Here

Examples of io.vertx.rxcore.java.timer.RxTimer

    sub.unsubscribe();
  }
 
  @Test
  public void testSetTimerCancelAfter() {
    RxTimer timer=new RxTimer(vertx);
   
    Observable<Long> ob=timer.setTimer(50);

    // Ensure we receive one element only
    final Subscription sub=assertCount(ob,1);
   
    vertx.setTimer(50+25,new Handler<Long>() {
View Full Code Here

Examples of io.vertx.rxcore.java.timer.RxTimer

    });
  }

  @Test
  public void testSetPeriodic() {
    RxTimer timer=new RxTimer(vertx);
   
    Observable<Long> ob=timer.setPeriodic(50).take(3);

    final long startTime=System.currentTimeMillis();

    // Expect 3 values
    final Subscription sub=assertCountThen(ob,new Action0() {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.