Package edu.wpi.grip.core
Class PipelineRunner
- java.lang.Object
-
- edu.wpi.grip.core.PipelineRunner
-
- All Implemented Interfaces:
com.google.common.util.concurrent.Service
,RestartableService
public class PipelineRunner extends java.lang.Object implements RestartableService
Runs the pipeline in a separate thread. The runner listens forRunPipelineEvents
and releases the pipeline thread to update the sources and run the steps.
-
-
Field Summary
-
Fields inherited from interface edu.wpi.grip.core.util.service.RestartableService
VALID_START_STATES
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(com.google.common.util.concurrent.Service.Listener listener, java.util.concurrent.Executor executor)
void
awaitRunning()
void
awaitRunning(long timeout, java.util.concurrent.TimeUnit unit)
void
awaitTerminated()
void
awaitTerminated(long timeout, java.util.concurrent.TimeUnit unit)
java.lang.Throwable
failureCause()
boolean
isRunning()
void
onBenchmarkEvent(BenchmarkEvent event)
void
onRunPipeline(RunPipelineEvent event)
void
onStopPipeline(StopPipelineEvent event)
PipelineRunner
startAsync()
Starts the pipeline to run at the default rate.com.google.common.util.concurrent.Service.State
state()
void
stopAndAwait()
void
stopAndAwait(long timeout, java.util.concurrent.TimeUnit unit)
PipelineRunner
stopAsync()
Stops the service.
-
-
-
Method Detail
-
startAsync
public PipelineRunner startAsync()
Starts the pipeline to run at the default rate.- Specified by:
startAsync
in interfaceRestartableService
- Specified by:
startAsync
in interfacecom.google.common.util.concurrent.Service
- Returns:
- this
-
isRunning
public boolean isRunning()
- Specified by:
isRunning
in interfacecom.google.common.util.concurrent.Service
-
state
public com.google.common.util.concurrent.Service.State state()
- Specified by:
state
in interfacecom.google.common.util.concurrent.Service
-
stopAsync
public PipelineRunner stopAsync()
Description copied from interface:RestartableService
Stops the service.- Specified by:
stopAsync
in interfaceRestartableService
- Specified by:
stopAsync
in interfacecom.google.common.util.concurrent.Service
- Returns:
- this
-
stopAndAwait
public void stopAndAwait()
- Specified by:
stopAndAwait
in interfaceRestartableService
-
stopAndAwait
public void stopAndAwait(long timeout, java.util.concurrent.TimeUnit unit) throws java.util.concurrent.TimeoutException
- Specified by:
stopAndAwait
in interfaceRestartableService
- Throws:
java.util.concurrent.TimeoutException
-
awaitRunning
public void awaitRunning()
- Specified by:
awaitRunning
in interfacecom.google.common.util.concurrent.Service
-
awaitRunning
public void awaitRunning(long timeout, java.util.concurrent.TimeUnit unit) throws java.util.concurrent.TimeoutException
- Specified by:
awaitRunning
in interfacecom.google.common.util.concurrent.Service
- Throws:
java.util.concurrent.TimeoutException
-
awaitTerminated
public void awaitTerminated()
- Specified by:
awaitTerminated
in interfacecom.google.common.util.concurrent.Service
-
awaitTerminated
public void awaitTerminated(long timeout, java.util.concurrent.TimeUnit unit) throws java.util.concurrent.TimeoutException
- Specified by:
awaitTerminated
in interfacecom.google.common.util.concurrent.Service
- Throws:
java.util.concurrent.TimeoutException
-
failureCause
public java.lang.Throwable failureCause()
- Specified by:
failureCause
in interfacecom.google.common.util.concurrent.Service
-
addListener
public void addListener(com.google.common.util.concurrent.Service.Listener listener, java.util.concurrent.Executor executor)
- Specified by:
addListener
in interfacecom.google.common.util.concurrent.Service
-
onRunPipeline
public void onRunPipeline(RunPipelineEvent event)
-
onStopPipeline
public void onStopPipeline(@Nullable StopPipelineEvent event)
-
onBenchmarkEvent
public void onBenchmarkEvent(BenchmarkEvent event)
-
-