Package io.vertx.core

Examples of io.vertx.core.TimeoutStream.endHandler()


  public void testTimerStreamCancellation() throws Exception {
    TimeoutStream timer = vertx.timerStream(10);
    timer.handler(l -> {
      fail();
    });
    timer.endHandler(v -> {
      testComplete();
    });
    timer.cancel();
    await();
  }
View Full Code Here


  @Test
  public void testTimeoutStreamEndCallbackAsynchronously1() {
    TimeoutStream stream = vertx.timerStream(10);
    ThreadLocal<Object> stack = new ThreadLocal<>();
    stack.set(true);
    stream.endHandler(v -> {
      assertTrue(vertx.context().isEventLoopContext());
      assertNull(stack.get());
      testComplete();
    });
    stream.handler(id -> {});
View Full Code Here

  // This test does not pass
  @Test
  public void testTimeoutStreamEndCallbackAsynchronously2() {
    TimeoutStream stream = vertx.periodicStream(10);
    ThreadLocal<Object> stack = new ThreadLocal<>();
    stream.endHandler(v -> {
      assertTrue(vertx.context().isEventLoopContext());
      assertNull(stack.get());
      testComplete();
    });
    stream.handler(id -> {
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.