PHP Class pocketmine\scheduler\AsyncTask

WARNING: Do not call PocketMine-MP API methods, or save objects from/on other Threads!!
Inheritance: extends Collectable
Afficher le fichier Open project: iTXTech/Genisys Class Usage Examples

Méthodes publiques

Свойство Type Description
$worker AsyncWorker

Méthodes publiques

Méthode Description
cancelRun ( )
cleanObject ( )
getFromThreadStore ( string $identifier ) : mixed Gets something into the local thread store.
getResult ( ) : mixed
getTaskId ( )
hasCancelledRun ( )
hasResult ( ) : boolean
isCrashed ( )
isFinished ( ) : boolean
isGarbage ( ) : boolean
onCompletion ( Server $server ) : void Actions to execute when completed (on main thread) Implement this if you want to handle the data in your AsyncTask after it has been processed
onRun ( ) : void Actions to execute when run
run ( )
saveToThreadStore ( string $identifier, mixed $value ) Saves something into the local thread store.
setGarbage ( )
setResult ( mixed $result, boolean $serialize = true )
setTaskId ( $taskId )

Method Details

cancelRun() public méthode

public cancelRun ( )

cleanObject() public méthode

public cleanObject ( )

getFromThreadStore() public méthode

You have to initialize this in some way from the task on run
public getFromThreadStore ( string $identifier ) : mixed
$identifier string
Résultat mixed

getResult() public méthode

public getResult ( ) : mixed
Résultat mixed

getTaskId() public méthode

public getTaskId ( )

hasCancelledRun() public méthode

public hasCancelledRun ( )

hasResult() public méthode

public hasResult ( ) : boolean
Résultat boolean

isCrashed() public méthode

public isCrashed ( )

isFinished() public méthode

public isFinished ( ) : boolean
Résultat boolean

isGarbage() public méthode

public isGarbage ( ) : boolean
Résultat boolean

onCompletion() public méthode

Actions to execute when completed (on main thread) Implement this if you want to handle the data in your AsyncTask after it has been processed
public onCompletion ( Server $server ) : void
$server pocketmine\Server
Résultat void

onRun() abstract public méthode

Actions to execute when run
abstract public onRun ( ) : void
Résultat void

run() public méthode

public run ( )

saveToThreadStore() public méthode

This might get deleted at any moment.
public saveToThreadStore ( string $identifier, mixed $value )
$identifier string
$value mixed

setGarbage() public méthode

public setGarbage ( )

setResult() public méthode

public setResult ( mixed $result, boolean $serialize = true )
$result mixed
$serialize boolean

setTaskId() public méthode

public setTaskId ( $taskId )

Property Details

$worker public_oe property

public AsyncWorker,pocketmine\scheduler $worker
Résultat AsyncWorker