Skip to content

ClosureTask ​

class · pocketmine\scheduler\ClosureTask · source

Extends Task

Task implementation which allows closures to be called by a scheduler.

Example usage:

TaskScheduler->scheduleTask(new ClosureTask(function() : void{
    echo "HI\n";
});

Methods ​

__construct() ​

php
public function __construct(\Closure $closure)

getName() ​

php
public function getName() : string

onRun() ​

php
public function onRun() : void

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.