You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some reason, threading in Python isn't really preferred (I never could understand why...). The BackgroundTaskManager currently uses threads to schedule and run various tasks simultaneously.
Since the code already exists, I don't plan on discarding it, but an option to not use threads would be rather nice. In such situations, an alternative function belonging to the Bot class will need to be called in an infinite loop, which will schedule the tasks using a simple check of elapsed time.
This change, along with a couple of bugfixes should be enough for version 1.
The text was updated successfully, but these errors were encountered:
ChatExchange uses threading anyway, so I really don't know if this makes sense. Perhaps if ChatExchange went async, it would make sense for us to follow suit.
(I'm certainly a threading skeptic, so I'm all for it in principle. No objection if we can lead the way; but I doubt our example could compel upstream to make large architectural changes.)
@tripleee I've used threads quite a lot, and I usually don't see any problem with them, but switching away from threads in the BackgroundTaskManager will have other advantages, IMO.
Currently, every task has it's own thread, which could make it difficult to debug some situations. Plus, async should use a lot less memory than the current threading system.
This isn't very high on my priority list (whenever I actually get time..), since some other bugs exist which block some functionality. But, I guess, it could be something nice to have.
For some reason, threading in Python isn't really preferred (I never could understand why...). The BackgroundTaskManager currently uses threads to schedule and run various tasks simultaneously.
Since the code already exists, I don't plan on discarding it, but an option to not use threads would be rather nice. In such situations, an alternative function belonging to the
Bot
class will need to be called in an infinite loop, which will schedule the tasks using a simple check of elapsed time.This change, along with a couple of bugfixes should be enough for version 1.
The text was updated successfully, but these errors were encountered: