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

How to close a scheduled repeating task.

Discussion in 'Help' started by StarCodeSuperior, May 31, 2022.

  1. StarCodeSuperior

    StarCodeSuperior Creeper

    Messages:
    2
    GitHub:
    starcodesuperior
    Here I'm cancelling all tasks but I want to cancel a single task. How to do it

    Here I'm just cancelling all tasks by $this->plugin->getScheduler()->cancelAllTasks();
    IMG_20220531_212332.jpg
    IMG_20220531_212855.jpg
     
  2. cosmicnebula

    cosmicnebula Spider

    Messages:
    8
    GitHub:
    cosmicnebula200
    instead of cancelling all the tasks, its advised to cancel the task via its handler
     
    zk408Dev likes this.
  3. StarCodeSuperior

    StarCodeSuperior Creeper

    Messages:
    2
    GitHub:
    starcodesuperior
    How give me an example plz
     
  4. Hen2527

    Hen2527 Creeper

    Messages:
    1
    GitHub:
    xqwtxon
    When canceling a task in pm4, please throw CancelTaskException.

    Considering using this:
    use pocketmine\scheduler\CancelTaskException;
    throw new CancelTaskException();
     
  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.