Class BotBrainLoop
A loop to handle updating bot brains.
Inherited Members
Namespace: Phoenix.BotBrain
Assembly: Phoenix.Plugin.BotBrain.Shared.dll
Syntax
public class BotBrainLoop
Remarks
Initializes a new instance of the BotBrainLoop class.
Constructors
View SourceBotBrainLoop(IBrainUpdater, TimeSpan, Action<Exception>)
A loop to handle updating bot brains.
Declaration
public BotBrainLoop(IBrainUpdater brainUpdater, TimeSpan tick, Action<Exception> handleError)
Parameters
Type | Name | Description |
---|---|---|
IBrainUpdater | brainUpdater | The brain updater. |
TimeSpan | tick | The loop interval. |
Action<Exception> | handleError | An action to handle exceptions from the loop. |
Remarks
Initializes a new instance of the BotBrainLoop class.
Properties
View SourceDelayBeforeAbortingBrainLoop
Gets the amount of time to wait before aborting the brain thread, if it doesn't respond to the stop request.
Declaration
protected virtual TimeSpan DelayBeforeAbortingBrainLoop { get; }
Property Value
Type | Description |
---|---|
TimeSpan |
IsRunning
Gets a value indicating whether or not the loop is running.
Declaration
public bool IsRunning { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
View SourceStart()
Starts the bot brain loop, if it isn't already started.
Declaration
public void Start()
StopAsync(TimeSpan?)
Stops the brain loop.
Declaration
public Task StopAsync(TimeSpan? delayBeforeAbort = null)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan? | delayBeforeAbort | Maximum amount of time to wait. |
Returns
Type | Description |
---|---|
Task | A task. |