alejandro5042 / Run-IrcBot

IRC Bot Toolkit for PowerShell
MIT License
13 stars 4 forks source link

Run BotScript in separate thread #3

Open alejandro5042 opened 10 years ago

alejandro5042 commented 10 years ago

Use Start-Job? We should isolate ourselves a bit more from the user's script. In addition, this would allow us to parse commands into a queue so that we don't overrun our input buffer. We can process commands as we have time. (Prioritize network access.)

Then we can look into having multiple instances of BotScript running. This is especially important if a bot gets a lot of requests that are long-running or is active in many channels. We could consider providing a simple synchronization primitive like so:

$Bot.Lock 'name' { script }
$Bot.Lock { script }             # use a default name