Package net.jodah.concurrentunit

Examples of net.jodah.concurrentunit.Waiter.resume()


    final Waiter waiter = new Waiter();
    waiter.expectResumes(expectedResumes);
    config.withConnectionListeners(new DefaultConnectionListener() {
      @Override
      public void onChannelRecovery(Connection connection) {
        waiter.resume();
      }

      @Override
      public void onRecoveryFailure(Connection connection, Throwable failure) {
        waiter.resume();
View Full Code Here


        waiter.resume();
      }

      @Override
      public void onRecoveryFailure(Connection connection, Throwable failure) {
        waiter.resume();
      }
    });

    config.withChannelListeners(new DefaultChannelListener() {
      @Override
View Full Code Here

    });

    config.withChannelListeners(new DefaultChannelListener() {
      @Override
      public void onRecovery(Channel channel) {
        waiter.resume();
      }

      @Override
      public void onRecoveryFailure(Channel channel, Throwable failure) {
        waiter.resume();
View Full Code Here

        waiter.resume();
      }

      @Override
      public void onRecoveryFailure(Channel channel, Throwable failure) {
        waiter.resume();
      }
    });

    // Mock recovery handling
    mockRecovery(recoveryResource instanceof ConnectionHandler ? connectionShutdownSignal()
View Full Code Here

    waiter.expectResume();
    runInThread(new Runnable() {
      public void run() {
        try {
          performInvocation();
          waiter.resume();
        } catch (Throwable t) {
          waiter.fail(t);
        }
      }
    });
View Full Code Here

        @Override
        public void run() {
          try {
            iw.await();
          } catch (InterruptedException expected) {
            waiter.resume();
          }
        }
      }).start();

    Thread.sleep(100);
View Full Code Here

        @Override
        public void run() {
          try {
            iw.await(Duration.mins(1));
          } catch (InterruptedException expected) {
            waiter.resume();
          }
        }
      }).start();

    Thread.sleep(100);
View Full Code Here

        public void run() {
          try {
            System.out.println("Waiting for circuit to be closed");
            circuit.await();
            System.out.println("Circuit closed");
            waiter.resume();
          } catch (InterruptedException e) {
            e.printStackTrace();
          }
        }
      }).start();
View Full Code Here

        public void run() {
          try {
            System.out.println("Waiting for circuit to be closed");
            circuit.await();
            System.out.println("Circuit closed");
            waiter.resume();
          } catch (InterruptedException e) {
            e.printStackTrace();
          }
        }
      }).start();
View Full Code Here

        @Override
        public void run() {
          try {
            circuit.await();
          } catch (InterruptedException e) {
            waiter.resume();
          }
        }
      }).start();

    Thread.sleep(300);
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.