Class RecurringRunnableExecutor

  • All Implemented Interfaces:
    java.util.concurrent.Executor

    
    public class RecurringRunnableExecutor
     implements Executor
                        

    Implements a single-threaded Executor of RecurringRunnables i.e. asynchronous tasks which determine by themselves the intervals (the lengths of which may vary) at which they are to be invoked. webrtc/modules/utility/interface/process_thread.h webrtc/modules/utility/source/process_thread_impl.cc webrtc/modules/utility/source/process_thread_impl.h

    Author:

    Lyubomir Marinov

    George Politis

    • Constructor Detail

      • RecurringRunnableExecutor

        RecurringRunnableExecutor(String name)
        Initializes a new RecurringRunnableExecutor instance.
        Parameters:
        name - a string to be added to the name of the thread which this instance will start.
    • Method Detail

      • deRegisterRecurringRunnable

         boolean deRegisterRecurringRunnable(RecurringRunnable recurringRunnable)

        De-registers a RecurringRunnable from this Executor so that its run is no longer invoked (by this instance).

        Parameters:
        recurringRunnable - the RecurringRunnable to de-register from this instance
        Returns:

        true if the list of RecurringRunnables of this instance changed because of the method call; otherwise, false

      • registerRecurringRunnable

         boolean registerRecurringRunnable(RecurringRunnable recurringRunnable)

        Registers a RecurringRunnable with this Executor so that its run is invoked (by this instance).

        Parameters:
        recurringRunnable - the RecurringRunnable to register with this instance
        Returns:

        true if the list of RecurringRunnables of this instance changed because of the method call; otherwise, false

      • startOrNotifyThread

         void startOrNotifyThread()

        Starts or notifies thread depending on and in accord with the state of this instance.