Package com.uber.cadence.internal.worker
Class NoopSuspendableWorker
- java.lang.Object
-
- com.uber.cadence.internal.worker.NoopSuspendableWorker
-
- All Implemented Interfaces:
Lifecycle
,Shutdownable
,Startable
,Suspendable
,SuspendableWorker
public class NoopSuspendableWorker extends java.lang.Object implements SuspendableWorker
Helper class that is used instead of null for non initialized worker. This eliminates needs for null checks when calling into it.
-
-
Constructor Summary
Constructors Constructor Description NoopSuspendableWorker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
awaitTermination(long timeout, java.util.concurrent.TimeUnit unit)
boolean
isShutdown()
boolean
isStarted()
boolean
isSuspended()
boolean
isTerminated()
void
resumePolling()
Allow new poll requests.void
shutdown()
void
shutdownNow()
void
start()
void
suspendPolling()
Do not make new poll requests.
-
-
-
Method Detail
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown
in interfaceShutdownable
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated
in interfaceShutdownable
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfaceShutdownable
-
shutdownNow
public void shutdownNow()
- Specified by:
shutdownNow
in interfaceShutdownable
-
awaitTermination
public void awaitTermination(long timeout, java.util.concurrent.TimeUnit unit)
- Specified by:
awaitTermination
in interfaceShutdownable
-
suspendPolling
public void suspendPolling()
Description copied from interface:Suspendable
Do not make new poll requests. Outstanding long polls still can return tasks after this method was called.- Specified by:
suspendPolling
in interfaceSuspendable
-
resumePolling
public void resumePolling()
Description copied from interface:Suspendable
Allow new poll requests.- Specified by:
resumePolling
in interfaceSuspendable
-
isSuspended
public boolean isSuspended()
- Specified by:
isSuspended
in interfaceSuspendable
-
-