GS: Add GSAsyncMode(bool) class to set async mode of script DoCommands
In asynchronous mode, don't wait for result of executed command, just fire-and-forget, and return estimated cost/result
This commit is contained in:
@@ -28,6 +28,11 @@ struct CommandAuxiliaryBase;
|
||||
*/
|
||||
typedef bool (ScriptModeProc)();
|
||||
|
||||
/**
|
||||
* The callback function for Async Mode-classes.
|
||||
*/
|
||||
typedef bool (ScriptAsyncModeProc)();
|
||||
|
||||
/**
|
||||
* Uper-parent object of all API classes. You should never use this class in
|
||||
* your script, as it doesn't publish any public functions. It is used
|
||||
@@ -173,6 +178,21 @@ protected:
|
||||
*/
|
||||
static ScriptObject *GetDoCommandModeInstance();
|
||||
|
||||
/**
|
||||
* Set the current async mode of your script to this proc.
|
||||
*/
|
||||
static void SetDoCommandAsyncMode(ScriptAsyncModeProc *proc, ScriptObject *instance);
|
||||
|
||||
/**
|
||||
* Get the current async mode your script is currently under.
|
||||
*/
|
||||
static ScriptModeProc *GetDoCommandAsyncMode();
|
||||
|
||||
/**
|
||||
* Get the instance of the current async mode your script is currently under.
|
||||
*/
|
||||
static ScriptObject *GetDoCommandAsyncModeInstance();
|
||||
|
||||
/**
|
||||
* Set the delay of the DoCommand.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user