Examples of AsyncClient


Examples of ch.unifr.nio.framework.examples.AsyncClient

        SocketAddress socketAddress = new InetSocketAddress(PORT);
        AsyncServer server = new AsyncServer(dispatcher, socketAddress);
        server.start();

        // start client
        AsyncClient client = new AsyncClient("localhost", PORT);

        // check
        assertEquals(AsyncServer.MESSAGE, client.getReceivedMessage());
    }
View Full Code Here

Examples of com.kurento.kms.thrift.api.KmsMediaServerService.AsyncClient

  private void sendRequest(final Request<? extends Object> request,
      final Class<JsonElement> resultClass,
      final Continuation<Response<JsonElement>> continuation,
      final boolean retry) {

    final AsyncClient client = clientPool.acquireAsync();

    try {
      client.invokeJsonRpc(request.toString(),
          new AsyncMethodCallback<AsyncClient.invokeJsonRpc_call>() {

            @Override
            public void onError(Exception exception) {
              clientPool.release(client);
View Full Code Here

Examples of edu.berkeley.sparrow.thrift.PongService.AsyncClient

  private static void pongUsingAsynchronousClient(String hostname) throws Exception {
    InetSocketAddress address = new InetSocketAddress(hostname, 12345);
    while (true) {
      Long t = System.nanoTime();
      AsyncClient client = pongClientPool.borrowClient(address);
      System.out.println("Getting client took " + ((System.nanoTime() - t) / (1000 * 1000)) +
                         "ms");
      client.ping("PING", new Callback(address, System.nanoTime()));
      Thread.sleep(30);
    }
  }
View Full Code Here

Examples of edu.berkeley.sparrow.thrift.SchedulerService.AsyncClient

      LOG.error("Did not find any scheduler info for request: " + taskId);
      return;
    }

    try {
      AsyncClient client = schedulerClientPool.borrowClient(scheduler);
      client.sendFrontendMessage(app, taskId, status, message,
          new sendFrontendMessageCallback(scheduler, client));
      LOG.debug("finished sending message");
    } catch (IOException e) {
      LOG.error(e);
    } catch (TException e) {
View Full Code Here

Examples of thrift.test.Srv.AsyncClient

      public void call(TAsyncMethodCall method) throws TException {
        // do nothing
      }
    };

    Srv.AsyncClient c = new AsyncClient(null, mockClientManager, null);
    c.Janky(0, null);
    try {
      c.checkReady();
      fail("should have hit an exception");
    } catch (Exception e) {
      // awesome
    }
  }
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.