mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 06:00:46 +00:00
By using a LongRunning hint, our callback handler loop will most likely be scheduled to run in it's own thread instead of using threadpool threads. With low amount of bots it doesn't matter - the amount of tasks is very small, and the amount of available threads provided by the runtime is usually really big, so scheduler is almost always running all the jobs at the same time without starvation whatsoever. But with crapload of bots executing crapload of tasks at the same time, we might observe low-to-medium thread starvation and context switching, that might put our most important callbacks handling task together with all other tasks, which could render callback loop delays when ASF is under heavy load. This small change is a hint to scheduler that this task should run on it's own thread and have highest 'priority' over all other normal tasks. This way our loop is never starved, and it also allows better tasks management. It's purely cosmetic - even without it there is no observable degradation that could create any side-effects, but we know that this task will run for a very long period, and it's important to keep ASF bot responsive to Steam events, so it should have highest priority and it's own thread