Examples of queueAsyncCallback()


Examples of org.commoncrawl.async.EventLoop.queueAsyncCallback()

    try {
      final EventLoop outerEventLoop = new EventLoop();
      outerEventLoop.start();
      final ThreadPoolExecutor targetExecutor = (ThreadPoolExecutor) Executors.newCachedThreadPool();
      final ThreadPoolExecutor sourceExecutor = (ThreadPoolExecutor) Executors.newCachedThreadPool();
      outerEventLoop.queueAsyncCallback(new Callbacks.Callback() {
       
        @Override
        public void execute() {

         
View Full Code Here

Examples of org.commoncrawl.async.EventLoop.queueAsyncCallback()

                public void requestComplete(org.commoncrawl.rpc.OutgoingMessageContext<UnitTestStruct1,UnitTestStruct1> request) {
                  System.out.println("Received Request Complete for Request:" + request.getRequestId() + " Thread:" + Thread.currentThread().getId());
                 
                  if (request.getOutput().getLongType() == 1) {
                    System.out.println("Shutdown Cmd Received");
                    outerEventLoop.queueAsyncCallback(new Callbacks.Callback() {
                     
                      @Override
                      public void execute() {
                        System.out.println("Killing Outer Event Loop - Thread:" + Thread.currentThread().getId());
                        outerEventLoop.stop();
View Full Code Here

Examples of org.commoncrawl.async.EventLoop.queueAsyncCallback()

  public void renderQueueStats(final JsonWriter jsonWriter)throws IOException {
    EventLoop eventLoop = getHost().getEventLoop();
    final AtomicReference<IOException> exceptionRef = new AtomicReference<IOException>();
    if (Thread.currentThread() != eventLoop.getEventThread()) {
      final Semaphore semaphore = new Semaphore(0);
      eventLoop.queueAsyncCallback(new Callback() {

        @Override
        public void execute() {
          try {
            renderQueueStatsInternal(jsonWriter);
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.