Representation of a remote JS async response object. 更多...
#include <WebJSFunction.h>
类 FWebJSResponse 继承关系图:Public 成员函数 | |
| template<typename T > | |
| void | Failure (T Arg) const |
| Indicate failed completion, passing an error message back to JS. 更多... | |
| void | Success () const |
| Indicate successful completion without a return value. 更多... | |
| template<typename T > | |
| void | Success (T Arg) const |
| Indicate successful completion passing a return value back. 更多... | |
Representation of a remote JS async response object.
UFUNCTIONs taking a FWebJSResponse will get it passed in automatically when called from a web browser. Pass a result or error back by invoking Success or Failure on the object. UFunctions accepting a FWebJSResponse should have a void return type, as any value returned from the function will be ignored. Calling the response methods does not have to happen before returning from the function, which means you can use this to implement asynchronous functionality.
Note that the remote object will become invalid as soon as a result has been delivered, so you can only call either Success or Failure once.
|
inline |
Indicate failed completion, passing an error message back to JS.
The remote Promise's catch() handler will be executed with the value passed as the error reason.
|
inline |
Indicate successful completion without a return value.
The remote Promise's then() handler will be executed without arguments.
|
inline |
Indicate successful completion passing a return value back.
The remote Promise's then() handler will be executed with the value passed as its single argument.