PocketMine-MP 5.23.3 git-f7687af337d001ddbcc47b8e773f014a33faa662
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

@phpstan-return TaskHandler<static>|null

Definition at line 35 of file Task.php.

Referenced by pocketmine\scheduler\TaskHandler\__construct().

+ Here is the caller graph for this function:

◆ 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 62 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

@phpstan-param TaskHandler<static>|null $taskHandler

Definition at line 46 of file Task.php.


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