asynchronously enqueues a message to SQS.

@return a Future object that will be notified when the operation is completed; never null
356609
public Future<SendMessageResult> sendMessage(SendMessageRequest request,
                                                 AsyncHandler<SendMessageRequest, SendMessageResult> handler) {
        QueueBufferCallback<SendMessageRequest, SendMessageResult> callback = null;
        if (handler != null) {
            callback = new QueueBufferCallback<SendMessageRequest, SendMessageResult>(handler, request);
        }
        QueueBufferFuture<SendMessageRequest, SendMessageResult> future = sendBuffer.sendMessage(request, callback);
        future.setBuffer(this);
        return future;
    }
1065821
private QYBaseRespMsg processMessageHandle(QYBaseReqMsg msg){
        if(CollectionUtil.isEmpty(messageHandles)){
            synchronized (LOCK){
                messageHandles = this.initMessageHandles();
            }
        }
        if(CollectionUtil.isNotEmpty(messageHandles)){
            for(QYMessageHandle messageHandle : messageHandles){
                QYBaseRespMsg resultMsg = null;
                boolean result;
                try{
                    result = messageHandle.beforeHandle(msg);
                }catch (Exception e){
                    result = false;
                }
                if(result){
                    resultMsg = messageHandle.handle(msg);
                }
                if(BeanUtil.nonNull(resultMsg)){
                    return resultMsg;
                }
            }
        }
        return null;
    }
304243
public CompletableFuture<Void> snapshot() {
    RaftPartitionServer server = this.server;
    if (server != null) {
      return server.snapshot();
    }
    return CompletableFuture.completedFuture(null);
  }
785861
@Override
    public java.util.concurrent.Future<CreateQueueResult> createQueueAsync(String queueName,
            com.amazonaws.handlers.AsyncHandler<CreateQueueRequest, CreateQueueResult> asyncHandler) {

        return createQueueAsync(new CreateQueueRequest().withQueueName(queueName), asyncHandler);
    }
743688
@Override
    public Queue getQueue() throws JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "getQueue");
        Queue q = (Queue) theDestination;
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "getQueue", q);
        return q;
    }
337703
public NodeT getNext() {
        String nextItemKey = queue.poll();
        if (nextItemKey == null) {
            return null;
        }
        return nodeTable.get(nextItemKey);
    }
807415
public final Long getMessageWaitTime() {
        /* If the transient has never been set, get the value in the message */
        if (cachedMessageWaitTime == null) {
            cachedMessageWaitTime = (Long) getHdr2().getField(JsHdr2Access.MESSAGEWAITTIME);
        }
        return cachedMessageWaitTime;
    }
301150
private javax.jms.Message messageHandler(MessageManager messageManager) throws JMSException {
        if (messageManager == null) {
            return null;
        }        
        javax.jms.Message message = messageManager.getMessage();
        
        // Notify PrefetchThread that message is dispatched
        this.messageDispatched();
        acknowledger.notifyMessageReceived((SQSMessage) message);
        return message;
    }
668372
function synchronous(promiseFactory) {
  return function () {
    var promise = queue.then(promiseFactory);
    queue = promise.catch(noop); // squelch
    return promise;
  };
}
772632
@Override
    public T next(long systemCurrentTimeMillis) {
        // drain all the waiting messages from the source (up to 10k)
        while (delayed.size() < 10000) {
            T event = source.next(systemCurrentTimeMillis);
            if (event == null) {
                break;
            }
            transformAndQueue(event, systemCurrentTimeMillis);
        }

        return delayed.nextReady(systemCurrentTimeMillis);
    }
880738
function () {
    var result = Q.resolve();

    // loop through all promises created by the remote methods
    // this is synchronous, so it waits if a method is finished before
    // the next one will be executed
    this.actionQueue.forEach(function (f) {
      result = result.then(f);
    });

    // flush the queue & fire an event
    // when the queue finished its executions
    result.then(this.flushQueue.bind(this));
    return this;
  }
382353
@Bean
    public Queue authenticationReceiverQueue() {
        return QueueBuilder.nonDurable(amqpProperties.getAuthenticationReceiverQueue()).autoDelete()
                .withArguments(getTTLMaxArgsAuthenticationQueue()).build();
    }
142317
private CompletableFuture<TableBucket> getNextBucket() {
        val fromBatch = getNextBucketFromExistingBatch();
        if (fromBatch != null) {
            return CompletableFuture.completedFuture(fromBatch);
        }

        val canContinue = new AtomicBoolean(true);
        return Futures.loop(canContinue::get, this::fetchNextTableBuckets, canContinue::set, this.executor)
                .thenApply(v -> getNextBucketFromExistingBatch());
    }
918634
public NotifyingFuture<V> poll(long timeout, TimeUnit unit) throws InterruptedException {
        return completionQueue.poll(timeout, unit);
    }
849065
public <T> Future<T> fireEventAsynchronously(final Event<?> event) {
        final FutureTask<T> futureTask = new FutureTask<T>(() -> {
            synchronizedEventQueue.fireEvent(event);

            return null; // XXX: Our future????
        });

        Latkes.EXECUTOR_SERVICE.execute(futureTask);

        return futureTask;
    }
919811
Future<HeaderCacheElement> asyncRefresh() {
    LOG.trace("asyncRefresh");

    synchronized (lock) {
      try {
        if (futureToken != null) {
          return futureToken;
        }
        if (headerCache.getCacheState() == CacheState.Good) {
          return Futures.immediateFuture(headerCache);
        }

        Future<HeaderCacheElement> future = executor.submit(new Callable<HeaderCacheElement>() {
          @Override
          public HeaderCacheElement call() {
            return updateToken();
          }
        });

        if (!future.isDone()) {
          this.futureToken = future;
        }
        return future;
      } catch (RuntimeException e) {
        futureToken = null;
        LOG.warn("Got an unexpected exception while trying to refresh google credentials.", e);
        return Futures.immediateFuture(new HeaderCacheElement(
          Status.UNAUTHENTICATED
              .withDescription("Unexpected error trying to authenticate")
              .withCause(e)));
      }
    }
  }
431753
@Override
    public java.util.concurrent.Future<ChangeMessageVisibilityBatchResult> changeMessageVisibilityBatchAsync(String queueUrl,
            java.util.List<ChangeMessageVisibilityBatchRequestEntry> entries,
            com.amazonaws.handlers.AsyncHandler<ChangeMessageVisibilityBatchRequest, ChangeMessageVisibilityBatchResult> asyncHandler) {

        return changeMessageVisibilityBatchAsync(new ChangeMessageVisibilityBatchRequest().withQueueUrl(queueUrl).withEntries(entries), asyncHandler);
    }