Class Promise<T>
java.lang.Object
com.inductiveautomation.ignition.common.script.builtin.http.Promise<T>
- Type Parameters:
- T- The return class of this promise - doesn't have to be a- Response...but it probably will be.
A 
Promise is, as the name implies, a rough analogue of other languages (such as JS)'s "Promise" class.
 Internally, relies on Java's powerful CompletableFutures, but makes things a little less confusing by
 hiding most of the more exotic methods.- 
Method SummaryModifier and TypeMethodDescriptionbooleancancel()Promise<?>handleException(org.python.core.PyObject callback) Return a new promise that will run the provided callback in the event of an exception, to attempt graceful error handling.booleanisDone()Promise<?>then(org.python.core.PyObject callback) Return a new promise that wraps this one's return value in a Python callable.toString()voidwhenComplete(org.python.core.PyObject callback) Call callback, asynchronously, whenever this future completes.
- 
Method Details- 
getpublic T get(org.python.core.PyObject[] args, String[] keywords) throws InterruptedException, ExecutionException, TimeoutException 
- 
getFuture
- 
thenReturn a new promise that wraps this one's return value in a Python callable. Callable will be called wrapped in aPromise.PyBiFunction.
- 
handleExceptionReturn a new promise that will run the provided callback in the event of an exception, to attempt graceful error handling.
- 
whenCompletepublic void whenComplete(org.python.core.PyObject callback) Call callback, asynchronously, whenever this future completes.
- 
cancelpublic boolean cancel()
- 
isDonepublic boolean isDone()
- 
toString
 
-