Class MainThreadCommandHandler
Basic handler of main thread commands. It queues the commands and executes any commands in the queue on update.
Implements
Inherited Members
Namespace: InsaneScatterbrain.Threading
Syntax
public class MainThreadCommandHandler : IMainThreadCommandHandler
Methods
Cancel()
Stops executing any active commands as soon as possible.
Declaration
public void Cancel()
Queue(IMainThreadCommand, bool)
Declaration
public void Queue(IMainThreadCommand command, bool waitForCompletion = true)
Parameters
Type | Name | Description |
---|---|---|
IMainThreadCommand | command | |
bool | waitForCompletion |
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()