Interface Task
- All Superinterfaces:
Cancelable,Runnable,SchedulingAwareRunnable
The actual
Task to run within the StreamMessageListenerContainer.- Since:
- 2.2
- Author:
- Mark Paluch
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumTheTask.Statedefining the lifecycle phase the actualTask. -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitStart(Duration timeout) Synchronous, blocking call that awaits until thisTaskbecomes active.getState()Get the current lifecycle phase.default booleanisActive()Methods inherited from interface org.springframework.data.redis.stream.Cancelable
cancelMethods inherited from interface org.springframework.scheduling.SchedulingAwareRunnable
isLongLived
-
Method Details
-
isActive
default boolean isActive()- Returns:
- true if the task is currently
running.
-
getState
Task.State getState()Get the current lifecycle phase.- Returns:
- never null.
-
awaitStart
Synchronous, blocking call that awaits until thisTaskbecomes active. Start awaiting is rearmed aftercancellingto support restart.- Parameters:
timeout- must not be null.- Returns:
trueif the task was started.falseif the waiting time elapsed before task was started.- Throws:
InterruptedException- if the current thread is interrupted while waiting.
-