Interface Request
- All Superinterfaces:
RequestWatcher
- All Known Implementing Classes:
SendRequestHandle
Represents an asynchronous request.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Cancels the request.get()Blocks until the request is complete and returns the result.getError()Returns the error that occurred during request execution, if any.voidonError(org.python.core.PyObject func) Registers a callback to be executed when the request fails.voidonSuccess(org.python.core.PyObject func) Registers a callback to be executed when the request completes successfully.Methods inherited from interface com.inductiveautomation.ignition.common.script.message.RequestWatcher
block, compose
-
Method Details
-
get
Blocks until the request is complete and returns the result.- Returns:
- The result of the request.
- Throws:
Exception- If an error occurred during request execution.
-
cancel
void cancel()Cancels the request. -
getError
Exception getError()Returns the error that occurred during request execution, if any.- Returns:
- The exception, or
nullif no error occurred.
-
onSuccess
void onSuccess(org.python.core.PyObject func) Registers a callback to be executed when the request completes successfully.- Parameters:
func- The Python function to call with the result.
-
onError
void onError(org.python.core.PyObject func) Registers a callback to be executed when the request fails.- Parameters:
func- The Python function to call with the exception.
-