java.lang.Object
io.evitadb.driver.ClientTask<S,T>
- All Implemented Interfaces:
Task<S,T>
Client task mimics the server task counterpart and provides the same interface for the client side. It is used to
track the status of the task and to cancel it if needed.
- Author:
- Jan Novotný (novotny@fg.cz), FG Forrest a.s. (c) 2024
-
Constructor Summary
ConstructorsConstructorDescriptionClientTask(TaskStatus<S, T> status) ClientTask(TaskStatus<S, T> status, Supplier<Function<UUID, Boolean>> cancellationLambdaFactory, Supplier<Function<UUID, Optional<TaskStatus<?, ?>>>> stateUpdater) -
Method Summary
Modifier and TypeMethodDescriptionbooleancancel()voiddiscard()Discards task locally (the server task is not cancelled).TaskStatus<S,T> booleanReturns true if the task is finished or cancelled.voidupdateStatus(TaskStatus<?, ?> status) Updates internal status of the task according to new external state.
-
Constructor Details
-
ClientTask
-
ClientTask
-
-
Method Details
-
getStatus
-
getFutureResult
- Specified by:
getFutureResultin interfaceTask<S,T>
-
cancel
public boolean cancel() -
discard
public void discard()Discards task locally (the server task is not cancelled). -
isCompleted
public boolean isCompleted()Returns true if the task is finished or cancelled.- Returns:
- True if the task is finished or cancelled.
-
updateStatus
Updates internal status of the task according to new external state.- Parameters:
status- The new status of the task.
-