1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Implemented Scheduler rewrite

Discussion in 'Contributing & RFCs' started by dktapps, May 30, 2018.

  1. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    This is a major change that will affect most PocketMine-MP plugins in the next release (if the RFC passes without issue).

    Please see the GitHub Pull Request for the full changeset.

    What exactly does this mean for plugin devs?
    A few cool things! Mostly it will just involve some small amount of rewiring.
    • Instead of having a global Server task scheduler, every plugin now has its own scheduler. This makes scheduling tasks syntactially much more pleasant.
    • Also, it allows providing isolation for tasks per plugin, which makes removing tasks on plugin disable much more robust and reliable, along with removing the need for plugin tasks to extend the PluginTask class.
    • The PluginTask class has been removed due to the above point, since it's now unnecessary.
    • The worker pool which executes AsyncTasks is now separate from the scheduler.
    But this breaks all my plugins!
    It does indeed! However, these changes offer a wide range of benefits (some described above). It also makes the code more modular and easier to unit test.

    So how do I fix my plugins?
    That's described in the GitHub Pull Request linked above. Also, remember that this change is not yet in a release, so you don't have to cater for it until it lands in a release.

    This is really cool! Wen ETA? OwO
    ...
     
  2. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    api-break.PNG
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.