-
- 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 {@code RecurringRunnable}from this{@code Executor}so that its run is no longer invoked (by this instance).voidexecute(Runnable command){@inheritDoc} Accepts for execution RecurringRunnables only. booleanregisterRecurringRunnable(RecurringRunnable recurringRunnable)Registers a {@code RecurringRunnable}with this{@code Executor}so 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 thisinstance will start.
-
-
Method Detail
-
deRegisterRecurringRunnable
boolean deRegisterRecurringRunnable(RecurringRunnable recurringRunnable)
De-registers a
{@code RecurringRunnable}from this{@code Executor}so that its run is no longer invoked (by this instance).- Parameters:
recurringRunnable- the tode-register from this instance
-
execute
void execute(Runnable command)
{@inheritDoc} Accepts for execution RecurringRunnables only.
-
registerRecurringRunnable
boolean registerRecurringRunnable(RecurringRunnable recurringRunnable)
Registers a
{@code RecurringRunnable}with this{@code Executor}so that its run is invoked (by this instance).- Parameters:
recurringRunnable- the to registerwith 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.
-
-
-
-