-
- 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}sothat its run is no longer invoked (bythis instance).voidexecute(Runnable command)Accepts for execution RecurringRunnables only. booleanregisterRecurringRunnable(RecurringRunnable recurringRunnable)Registers a {@code RecurringRunnable}with this{@code Executor}sothat its run is invoked (by thisinstance).voidstartOrNotifyThread()Starts or notifies thread depending on and in accord with thestate of this instance. voidclose()Closes this RecurringRunnableExecutor, signalling its thread tostop 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}sothat its run is no longer invoked (bythis instance).- Parameters:
recurringRunnable- the{@code RecurringRunnable}tode-register from this instance
-
execute
void execute(Runnable command)
Accepts for execution RecurringRunnables only.
-
registerRecurringRunnable
boolean registerRecurringRunnable(RecurringRunnable recurringRunnable)
Registers a
{@code RecurringRunnable}with this{@code Executor}sothat its run is invoked (by thisinstance).- Parameters:
recurringRunnable- the{@code RecurringRunnable}to registerwith this instance
-
startOrNotifyThread
void startOrNotifyThread()
Starts or notifies thread depending on and in accord with thestate of this instance.
-
close
void close()
Closes this RecurringRunnableExecutor, signalling its thread tostop and de-registering all registered runnables.
-
-
-
-