Class MainThreadCommandHandler
Basic handler of main thread commands. It queues the commands and executes any commands in the queue on update.
Inherited Members
Namespace: InsaneScatterbrain.Threading
Syntax
public class MainThreadCommandHandler
Methods
Cancel()
Stops executing any active commands as soon as possible.
Declaration
public void Cancel()
Queue(MainThreadCommand, bool)
Queues the command for executing on the next update.
Declaration
public void Queue(MainThreadCommand command, bool waitForCompletion = true)
Parameters
| Type | Name | Description |
|---|---|---|
| MainThreadCommand | command | The command to execute. |
| bool | waitForCompletion | Whether or not the calling thread should wait for completion of this command before continuing code execution. |
Queue(Action, bool)
Queues the command for executing on the next update.
Declaration
[Obsolete("This overload will likely be removed in 2.0.")]
public void Queue(Action action, bool waitForCompletion = true)
Parameters
| Type | Name | Description |
|---|---|---|
| Action | action | The action to execute. |
| bool | waitForCompletion | Whether or not the calling thread should wait for completion of this command before continuing code execution. |
Update()
Executes all queued commands on the main thread. If they're done, they are removed from the queue.
Declaration
public void Update()