-
- 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
-
-
Constructor Summary
Constructors Constructor Description RecurringRunnableExecutor()Initializes a new RecurringRunnableExecutor instance. RecurringRunnableExecutor(String name)Initializes a new RecurringRunnableExecutor instance.
-
Method Summary
Modifier and Type Method Description booleandeRegisterRecurringRunnable(RecurringRunnable recurringRunnable)De-registers a RecurringRunnablefrom thisExecutorso that its run is no longer invoked (by this instance).voidexecute(Runnable command)Accepts for execution RecurringRunnables only. booleanregisterRecurringRunnable(RecurringRunnable recurringRunnable)Registers a RecurringRunnablewith thisExecutorso that its run is invoked (by this instance).voidstartOrNotifyThread()Starts or notifies thread depending on and in accord with the state of this instance. voidclose()Closes this RecurringRunnableExecutor, signalling its thread to stop and de-registering all registered runnables. -
-
Constructor Detail
-
RecurringRunnableExecutor
RecurringRunnableExecutor()
Initializes a new RecurringRunnableExecutor instance.
-
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
RecurringRunnablefrom thisExecutorso that its run is no longer invoked (by this instance).- Parameters:
recurringRunnable- theRecurringRunnableto de-register from this instance
-
execute
void execute(Runnable command)
Accepts for execution RecurringRunnables only.
-
registerRecurringRunnable
boolean registerRecurringRunnable(RecurringRunnable recurringRunnable)
Registers a
RecurringRunnablewith thisExecutorso that its run is invoked (by this instance).- Parameters:
recurringRunnable- theRecurringRunnableto register with this instance
-
startOrNotifyThread
void startOrNotifyThread()
Starts or notifies thread depending on and in accord with the state of this instance.
-
close
void close()
Closes this RecurringRunnableExecutor, signalling its thread to stop and de-registering all registered runnables.
-
-
-
-