Interface GatewayProgressManager
- All Superinterfaces:
ProgressManager
The GatewayProgressManager is used to execute tasks on the gateway that might take a while. The tasks are initiated
by a client (usually a designer), and updates on the task's state are fed back to the client progress system through
the gateway's push mechanism.
The running tasks publish updates by retrieving the current progress listener for their thread through the function on this interface. This method is used due to the way that methods are invoked by the client on the gateway.
The easiest way to use this system is to write a GatewayFunc annotated function, and use the "asyncInvoke" flag of that annotation. That will cause the function to be passed through this system automatically.
-
Field Summary
Fields inherited from interface com.inductiveautomation.ignition.common.gui.progress.ProgressManager
PUSH_PROTOCOL_UPDATE
-
Method Summary
Modifier and TypeMethodDescriptionReturns the TaskProgressListener registered for the calling thread.runAsyncTask
(String sessionid, GatewayProgressRunnable task) Registers a task to run asynchronously.void
-
Method Details
-
runAsyncTask
Registers a task to run asynchronously. The provided task will be run in a different thread, who will have a threadlocal TaskProgressListener that can be updated. The registration returns a task uid that can be used to monitor the state.- Parameters:
sessionid
- the client session that is interested in the progress of this task.task
- the runnable to execute.- Returns:
- the task uid
-
getProgressListenerForThread
TaskProgressListener getProgressListenerForThread()Returns the TaskProgressListener registered for the calling thread. If no listener is registered, a "dummy" listener will be returned that will discard updates.- Returns:
- a TaskProgressListener, guaranteed to not be null.
-
setProgressListenerForThread
-