Examples of Cancellable


Examples of akka.actor.Cancellable

   
    ActorRef tickActor = system.actorOf(Props.create(Ticker.class, this));

    //This will schedule to send the Tick-message
    //to the tickActor after 0ms repeating every 50ms
    Cancellable cancellable = system.scheduler().schedule(Duration.Zero(),
    Duration.create(50, TimeUnit.MILLISECONDS), tickActor, "Tick",
    system.dispatcher(), null);

    //This cancels further Ticks to be sent
    cancellable.cancel();
    //#schedule-recurring
    system.stop(tickActor);
  }
View Full Code Here

Examples of com.linkedin.parseq.Cancellable

      @Override
      public void onResolved(Promise<Object> resolvedPromise)
      {
        for (Iterator<Cancellable> it = _cancellables.iterator(); it.hasNext(); )
        {
          final Cancellable cancellable = it.next();
          cancellable.cancel(EARLY_FINISH_EXCEPTION);
          it.remove();
        }
      }
    });
View Full Code Here

Examples of com.linkedin.parseq.Cancellable

  @Override
  public Cancellable createTimer(final long time, final TimeUnit unit,
                                 final Task<?> task)
  {
    checkInTask();
    final Cancellable cancellable = _planContext.schedule(time, unit, new Runnable()
    {
      @Override
      public void run()
      {
        runSubTask(task, NO_PREDECESSORS);
View Full Code Here

Examples of com.linkedin.r2.util.Cancellable

    trc("enqueued a waiter");
    if (create)
    {
      create();
    }
    return new Cancellable()
    {
      @Override
      public boolean cancel()
      {
        synchronized (_lock)
View Full Code Here

Examples of nexj.core.util.Cancellable

    * @param cancellable The current cancellable object to set. Can be null.
    * @return The old cancellable object. Can be null.
    */
   public synchronized Cancellable setCancellable(Cancellable cancellable)
   {
      Cancellable old = m_cancellable;

      m_cancellable = cancellable;

      return old;
   }
View Full Code Here

Examples of nexj.core.util.Cancellable

    * Cancels any blocked processes.
    * @see Cancellable#cancel()
    */
   public void cancel()
   {
      Cancellable cancellable;

      synchronized (this)
      {
         cancellable = m_cancellable;
      }

      if (cancellable != null)
      {
         cancellable.cancel();
      }
   }
View Full Code Here

Examples of org.apache.http.concurrent.Cancellable

        conn.getContext().setAttribute(HTTP_EXCHANGE, httpExchange);
    }

    public void closed(final NHttpServerConnection conn) {
        HttpExchange httpExchange = ensureNotNull(getHttpExchange(conn));
        Cancellable asyncProcess = httpExchange.getAsyncProcess();
        httpExchange.clear();
        if (asyncProcess != null) {
            asyncProcess.cancel();
        }
    }
View Full Code Here

Examples of org.apache.http.concurrent.Cancellable

                if (((HttpEntityEnclosingRequest) request).expectContinue()) {
                    httpExchange.setRequestState(MessageState.ACK_EXPECTED);
                    if (this.expectationVerifier != null) {
                        conn.suspendInput();
                        HttpAsyncContinueTrigger trigger = new ContinueTriggerImpl(httpExchange, conn);
                        Cancellable asyncProcess = this.expectationVerifier.verify(request, trigger, context);
                        httpExchange.setAsyncProcess(asyncProcess);
                    } else {
                        HttpResponse response = create100Continue(request);
                        conn.submitResponse(response);
                        httpExchange.setRequestState(MessageState.BODY_STREAM);
View Full Code Here

Examples of org.apache.http.concurrent.Cancellable

            conn.requestOutput();
        } else {
            Object result = consumer.getResult();
            HttpAsyncResponseTrigger trigger = new ResponseTriggerImpl(httpExchange, conn);
            try {
                Cancellable asyncProcess = handler.handle(result, trigger, context);
                httpExchange.setAsyncProcess(asyncProcess);
            } catch (HttpException ex) {
                HttpAsyncResponseProducer responseProducer = handleException(ex);
                httpExchange.setResponseProducer(responseProducer);
                conn.requestOutput();
View Full Code Here

Examples of org.apache.http.concurrent.Cancellable

    public void closed(final NHttpServerConnection conn) {
        final State state = getState(conn);
        if (state != null) {
            state.setTerminated();
            closeHandlers(state);
            final Cancellable cancellable = state.getCancellable();
            if (cancellable != null) {
                cancellable.cancel();
            }
            state.reset();
        }
    }
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.