Package com.uber.cadence.internal.worker
Class Poller<T>
- java.lang.Object
-
- com.uber.cadence.internal.worker.Poller<T>
-
- All Implemented Interfaces:
Lifecycle
,Shutdownable
,Startable
,Suspendable
,SuspendableWorker
public final class Poller<T> extends java.lang.Object implements SuspendableWorker
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Poller.PollTask<TT>
-
Constructor Summary
Constructors Constructor Description Poller(java.lang.String identity, Poller.PollTask<T> pollTask, ShutdownableTaskExecutor<T> taskExecutor, PollerOptions pollerOptions, com.uber.m3.tally.Scope metricsScope)
-
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.java.lang.String
toString()
-
-
-
Constructor Detail
-
Poller
public Poller(java.lang.String identity, Poller.PollTask<T> pollTask, ShutdownableTaskExecutor<T> taskExecutor, PollerOptions pollerOptions, com.uber.m3.tally.Scope metricsScope)
-
-
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
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-