PocketMine-MP 5.21.2 git-b2aa6396c3cc2cafdd815eacc360e1ad89599899
Loading...
Searching...
No Matches
pocketmine\scheduler\ClosureTask Class Reference
+ Inheritance diagram for pocketmine\scheduler\ClosureTask:
+ Collaboration diagram for pocketmine\scheduler\ClosureTask:

Public Member Functions

 __construct (private \Closure $closure)
 
 getHandler ()
 
 getName ()
 
 onCancel ()
 
 onRun ()
 
 setHandler (?TaskHandler $taskHandler)
 

Detailed Description

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

Example usage:

Definition at line 41 of file ClosureTask.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\scheduler\ClosureTask::__construct ( private \Closure $closure)
Parameters
\Closure$closureMust accept zero parameters @phpstan-param \Closure() : void $closure

Definition at line 46 of file ClosureTask.php.

Member Function Documentation

◆ getHandler()

pocketmine\scheduler\Task::getHandler ( )
finalinherited

Definition at line 31 of file Task.php.

◆ getName()

pocketmine\scheduler\ClosureTask::getName ( )

Reimplemented from pocketmine\scheduler\Task.

Definition at line 52 of file ClosureTask.php.

◆ onCancel()

pocketmine\scheduler\Task::onCancel ( )
inherited

Actions to execute if the Task is cancelled

Definition at line 55 of file Task.php.

◆ onRun()

pocketmine\scheduler\ClosureTask::onRun ( )

Actions to execute when run

Exceptions
CancelTaskException

Reimplemented from pocketmine\scheduler\Task.

Definition at line 56 of file ClosureTask.php.

◆ setHandler()

pocketmine\scheduler\Task::setHandler ( ?TaskHandler $taskHandler)
finalinherited

Definition at line 39 of file Task.php.


The documentation for this class was generated from the following file: