Interface Task
- All Superinterfaces:
Cancelable
,Runnable
,SchedulingAwareRunnable
The actual
Task
to run within the StreamMessageListenerContainer
.- Since:
- 2.2
- Author:
- Mark Paluch
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
TheTask.State
defining the lifecycle phase the actualTask
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
awaitStart
(Duration timeout) Synchronous, blocking call that awaits until thisTask
becomes active.getState()
Get the current lifecycle phase.default boolean
isActive()
Methods inherited from interface org.springframework.data.redis.stream.Cancelable
cancel
Methods 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 thisTask
becomes active. Start awaiting is rearmed aftercancelling
to support restart.- Parameters:
timeout
- must not be null.- Returns:
true
if the task was started.false
if the waiting time elapsed before task was started.- Throws:
InterruptedException
- if the current thread is interrupted while waiting.
-