Class AsyncExecutor<T>

  • All Implemented Interfaces:
    Lifecycle

    public class AsyncExecutor<T>
    extends java.lang.Object
    implements Lifecycle
    Used to execute asynchronous tasks, e.g. async-send (https://issues.redhat.com/browse/JGRP-2603). Uses a blockng queue and a dequeuer thread, which passes removed tasks to the thread pool
    Since:
    5.3.5
    Author:
    Bela Ban
    • Field Detail

      • enabled

        protected boolean enabled
      • num_sends

        protected final java.util.concurrent.atomic.LongAdder num_sends
      • num_rejected

        protected final java.util.concurrent.atomic.LongAdder num_rejected
      • num_drops_on_full_thread_pool

        protected final java.util.concurrent.atomic.LongAdder num_drops_on_full_thread_pool
      • num_sends_on_callers_thread

        protected final java.util.concurrent.atomic.LongAdder num_sends_on_callers_thread
      • executor

        protected java.util.concurrent.Executor executor
    • Constructor Detail

      • AsyncExecutor

        public AsyncExecutor()
      • AsyncExecutor

        public AsyncExecutor​(ThreadPool p)
    • Method Detail

      • enabled

        public boolean enabled()
      • numSends

        public long numSends()
      • numSendsOnCallersThread

        public long numSendsOnCallersThread()
      • numDropsOnFullThreadPool

        public long numDropsOnFullThreadPool()
      • numRejected

        public long numRejected()
      • resetStats

        public void resetStats()
      • execute

        public java.util.concurrent.CompletableFuture<T> execute​(java.util.function.Supplier<T> t,
                                                                 boolean can_be_dropped)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • exec

        protected java.util.concurrent.Executor exec()