// Preferred method (for code clarity):
// retrieve "foo" then run it
Processes("foo").run(runData, ignoreQueueSize);
// Exactly the same as doing this:
Processes("foo")(runData, ignoreQueueSize); -- see instance()
// Alternate method (for code brevity):
// run a "foo" via it's global function
foo.run(runData, ignoreQueueSize);
// Exactly the same as:
foo(runData, ignoreQueueSize);
// ...all four methods do exactly the same thing, they are just different syntaxes.
Parameters
Parameter
Type
Mandatory
Notes
Pulse Version
runData
Variant
Optionally pass in a value or an object that will be exposed to Tasks, and some events, as the "runData" parameter. See Notes section below for additional information.
Defaults to an empty object.
0.1
ignoreQueueSize
Boolean
If set to true, warnings about excessive run queue size will be suppressed. This is useful when you might be using a game event to run a process in which case several process runs might be issued in short succession within the same game tick.
The process instance is returned, so you can chain more instance methods, eg:
Processes("foo").run(...).addTask(...);
0.1
Notes
Each time a new instance run is started, the runData parameter is pushed in to a stack so that each run can be given its applicable runData. When the current run finishes, its runData is removed from the stack and the next run starts.
If a trigger has more than PROCESS_MAX_QUEUE runs in its queue, warning messages will be shown to indicate that developer attention is likely required (basically the process instance is becoming overloaded). If you expect to be issuing multiple runs on an instance in short succession, for example because a game event is triggering it, set the ignoreQueueSize parameter to true to avoid such warnings.