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 voidcancelDelayedTask(ExecutionService.Cancellable cancellableTask)Best effort cancellation of a delayed task.voiddumpState()static voiddumpThreads()ExecutionService.CloseableExecutorgetConcurrentExecutor()Get the concurrent execution service.ExecutionService.CloseableExecutorgetSerialExecutor()Get a new, serial executor.static booleanthrottled()-
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:ExecutionServiceGet 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:
getSerialExecutorin interfaceExecutionService- Returns:
- a serial executor.
-
getConcurrentExecutor
@NonNull public ExecutionService.CloseableExecutor getConcurrentExecutor()
Description copied from interface:ExecutionServiceGet 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:
getConcurrentExecutorin interfaceExecutionService- Returns:
- the background thread-pool executor.
-
cancelDelayedTask
public void cancelDelayedTask(@NonNull ExecutionService.Cancellable cancellableTask)Description copied from interface:ExecutionServiceBest effort cancellation of a delayed task.- Specified by:
cancelDelayedTaskin interfaceExecutionService- Parameters:
cancellableTask- object returned by a previous call to postDelayedOnExecutor.
-
dumpState
public void dumpState()
-
-