Package com.couchbase.lite.internal.exec
Class AbstractExecutionService
- java.lang.Object
-
- com.couchbase.lite.internal.exec.AbstractExecutionService
-
- All Implemented Interfaces:
ExecutionService
- Direct Known Subclasses:
AndroidExecutionService
public abstract class AbstractExecutionService extends Object implements ExecutionService
Base ExecutionService that provides the default implementation of serial and concurrent executor.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.couchbase.lite.internal.exec.ExecutionService
ExecutionService.Cancellable, ExecutionService.CloseableExecutor
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancelDelayedTask(ExecutionService.Cancellable cancellableTask)
Best effort cancellation of a delayed task.void
dumpState()
static void
dumpThreads()
ExecutionService.CloseableExecutor
getConcurrentExecutor()
Get the concurrent execution service.ExecutionService.CloseableExecutor
getSerialExecutor()
Get a new, serial executor.static boolean
throttled()
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.couchbase.lite.internal.exec.ExecutionService
getDefaultExecutor, postDelayedOnExecutor
-
-
-
-
Method Detail
-
throttled
public static boolean throttled()
-
dumpThreads
public static void dumpThreads()
-
getSerialExecutor
@NonNull public ExecutionService.CloseableExecutor getSerialExecutor()
Description copied from interface:ExecutionService
Get a new, serial executor. Not a single thread but does guarantee serial execution. Suitable for heavyweight that must be executed in order. That is most of them.- Specified by:
getSerialExecutor
in interfaceExecutionService
- Returns:
- a serial executor.
-
getConcurrentExecutor
@NonNull public ExecutionService.CloseableExecutor getConcurrentExecutor()
Description copied from interface:ExecutionService
Get the concurrent execution service. Executes tasks on a multi-threaded Executor. Suitable for heavyweight tasks. There is no guarantee for order of execution.- Specified by:
getConcurrentExecutor
in interfaceExecutionService
- Returns:
- the background thread-pool executor.
-
cancelDelayedTask
public void cancelDelayedTask(@NonNull ExecutionService.Cancellable cancellableTask)
Description copied from interface:ExecutionService
Best effort cancellation of a delayed task.- Specified by:
cancelDelayedTask
in interfaceExecutionService
- Parameters:
cancellableTask
- object returned by a previous call to postDelayedOnExecutor.
-
dumpState
public void dumpState()
-
-