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
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: