PHP Class AsyncTask

Author: Dmitry Mamontov ([email protected])
Afficher le fichier Open project: dmamontov/asynctask Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( ) : void Creates a new asynchronous task
__destruct ( ) : void Finish create an asynchronous task
cancel ( ) : boolean Attempts to cancel execution of this task
execute ( mixed $parameters ) : void Executes the task with the specified parameters
getStatus ( ) : string Returns the current status of this task
isCancelled ( ) : boolean Returns true if this task was cancelled before it completed normally

Méthodes protégées

Méthode Description
doInBackground ( mixed $parameters ) : mixed Override this method to perform a computation on a background thread
getProperty ( string $key ) : mixed Returns the variable with the given key
onCancelled ( ) : void Runs on the thread after cancel()
onPostExecute ( mixed $result ) : void Runs on the thread after doInBackground($parameters)
onPreExecute ( ) : void Runs on the thread before doInBackground($parameters)
setProperty ( string $key, string $value ) : boolean Inserts or updates a variable with the given key

Private Methods

Méthode Description
getUid ( string $key ) : integer Returns a unique integer identifier for a given key

Method Details

__construct() final public méthode

Creates a new asynchronous task
final public __construct ( ) : void
Résultat void

__destruct() final public méthode

Finish create an asynchronous task
final public __destruct ( ) : void
Résultat void

cancel() final public méthode

Attempts to cancel execution of this task
final public cancel ( ) : boolean
Résultat boolean

doInBackground() abstract protected méthode

Override this method to perform a computation on a background thread
abstract protected doInBackground ( mixed $parameters ) : mixed
$parameters mixed
Résultat mixed

execute() final public méthode

Executes the task with the specified parameters
final public execute ( mixed $parameters ) : void
$parameters mixed
Résultat void

getProperty() final protected static méthode

Returns the variable with the given key
final protected static getProperty ( string $key ) : mixed
$key string
Résultat mixed

getStatus() final public méthode

Returns the current status of this task
final public getStatus ( ) : string
Résultat string

isCancelled() final public méthode

Returns true if this task was cancelled before it completed normally
final public isCancelled ( ) : boolean
Résultat boolean

onCancelled() protected méthode

Runs on the thread after cancel()
protected onCancelled ( ) : void
Résultat void

onPostExecute() protected méthode

Runs on the thread after doInBackground($parameters)
protected onPostExecute ( mixed $result ) : void
$result mixed
Résultat void

onPreExecute() protected méthode

Runs on the thread before doInBackground($parameters)
protected onPreExecute ( ) : void
Résultat void

setProperty() final protected static méthode

Inserts or updates a variable with the given key
final protected static setProperty ( string $key, string $value ) : boolean
$key string
$value string
Résultat boolean