Skip to content

dynamic scheduling

Pre-release
Pre-release
Compare
Choose a tag to compare
@Trimatix Trimatix released this 23 May 22:42
· 137 commits to master since this release
  1. Central dynamic scheduler
    The biggest change in this update is the start of moving from multiple task schedulers to a single scheduler. You can still use task references, but you should not rely on maintaining multiple schedulers to keep track of your tasks.
    v0.5 also adds the new "dynamic" scheduler, which automatically yields its thread until the soonest-expiring timedtask is due to expire. In essence, AutoCheckingTimedTaskHeap is an interrupts-based scheduler, whereas TimedTaskHeap can be seen as polling-based. It will also handle its own task expiry thread, meaning you don't need to have a main loop in your client.

  2. Configurator timeouts
    the timeouts config variable is now special-cased to allow for multi-level serialization. The configurator module, and this special-cased variable, are both planned to be overhauled and separated into a separate package.

  3. Run scripts removed
    BASED no longer supports code deployment with git out of the box. This means that run scripts are now obsolete, and automatic restarting should instead be handled by your container software. In accordance, the restart and update commands have also been removed.

  4. SaveableMenu decorator
    Relying on a public class attribute for menu saveability was not a viable long-term solution. Any class saveable attributes will now be completely disregarded, and can be removed unless you have your own behaviour which uses them. Instead, reaction menus are now marked as saveable using the new reactionMenu.saveableMenu class decorator. Simply placing this decorator before your subclass declaration will set up your menu type for serializing and deserializing, with no extra input needed, other than the implementations of serializer methods toDict and fromDict. You may also wish to check the new utility functions in reactionMenu.py, being isSaveableMenuClass, isSaveableMenuInstance, isSaveableMenuTypeName, and saveableMenuClassFromName. Unfortunately, to allow for portability, classes are identified ENTIRELy by their names. As such, attempting to register two reactionMenu subclasses with the same name as saveable is not supported.

  5. Updated emoji support
    BASED now supports the latest version of the emoji library. This was original handled by specifying an emoji library, but has since been changed to use emoji's built-in regex. The regional indicator emojis (🇦, 🇧, 🇨...), which are accepted by discord emojis but are not registered as emojis under the emoji consortium, will not be accepted into the emoji library standard, and have instead been special-cased. For details, see the PR here. Finally, emoji display mode indicators are now special-cased and stripped as well. This fixes false-negatives with emojis such as ⚒. I imagine more invisible characters such as this will need to be added in the future.

Misc

  • fix erroneous exception swallowing when importing commands modules
  • fix BasedEmoji.fromReaction references in SingleUserReactionMenu.doMenu
  • added draft tox.ini with a few PEP standards ignored to align with my personal code style