Reconsider refactoring the InputHandler to use Tasks
Currently, each input sequence is processed on a dedicated thread. This means TRBot is capable of handling only a given number of input sequences at a time. On more powerful machines, this is a non-issue, but less capable machines could have problems keeping up on very active streams.
The second comment on this StackOverflow answer sums this up very well.
"One of the major advantages of async code is to allow one thread to work on multiple tasks at once, by avoiding blocking calls. This avoids the need for huge amounts of individual threads, and allows a threadpool to service many requests at once. However, given that async code usually runs on the threadpool, needlessly blocking a single thread with Thread.Sleep() consumes an entire thread that could otherwise be used elsewhere. If many tasks are run with Thread.Sleep(), there's a high chance of exhausting all threadpool threads and seriously hindering performance."
One of the challenges in the previous attempt at this was stopping all inputs. For some reason,
Task.WaitAll was throwing exceptions occassionally. This may be prevented by implementing it differently this time around.
Deleting a branch is permanent. It CANNOT be undone. Continue?