public class AsyncRunner extends GraphRunner
GraphRunner.OnRunnerDoneListener
mFilterContext, RESULT_BLOCKED, RESULT_ERROR, RESULT_FINISHED, RESULT_RUNNING, RESULT_SLEEPING, RESULT_STOPPED, RESULT_UNKNOWN
Constructor and Description |
---|
AsyncRunner(FilterContext context)
Create a new asynchronous graph runner with the given filter
context.
|
AsyncRunner(FilterContext context,
Class schedulerClass)
Create a new asynchronous graph runner with the given filter
context, and the given scheduler class.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the filters in a graph.
|
Exception |
getError()
Returns the last exception that happened during an asynchronous run.
|
FilterGraph |
getGraph() |
boolean |
isRunning()
Check if background processing is happening
|
void |
run()
Execute the graph in a background thread.
|
void |
setDoneCallback(GraphRunner.OnRunnerDoneListener listener)
Set a callback to be called in the UI thread once the AsyncRunner
completes running a graph, whether the completion is due to a stop() call
or the filters running out of data to process.
|
void |
setGraph(FilterGraph graph)
Sets the graph to be run.
|
void |
stop()
Stop graph execution.
|
activateGlContext, deactivateGlContext, getContext
public AsyncRunner(FilterContext context, Class schedulerClass)
public AsyncRunner(FilterContext context)
public void setDoneCallback(GraphRunner.OnRunnerDoneListener listener)
setDoneCallback
in class GraphRunner
public void setGraph(FilterGraph graph)
public FilterGraph getGraph()
getGraph
in class GraphRunner
public void run()
run
in class GraphRunner
public void stop()
stop
in class GraphRunner
public void close()
GraphRunner
close
in class GraphRunner
public boolean isRunning()
isRunning
in class GraphRunner
public Exception getError()
GraphRunner
getError
in class GraphRunner