Skip to content

AsyncTask enables proper and easy use of the thread. This class allows to perform background operations and publish results on the thread without having to manipulate threads and/or handlers.

License

skipperbent/asynctask

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Latest Stable Version License Total Downloads PHP Classes

AsyncTask

AsyncTask enables proper and easy use of the thread. This class allows to perform background operations and publish results on the thread without having to manipulate threads and/or handlers. More information.

Fork description

Forked to support HHVM

Requirements

  • PHP version ~5.3.3
  • Module installed pcntl and posix
  • All functions pcntl, posix and shm removed from the directive disable_functions

Installation

  1. Install composer

  2. Follow in the project folder:

composer require dmamontov/asynctask ~1.0.5

In config composer.json your project will be added to the library dmamontov/asynctask, who settled in the folder vendor/. In the absence of a config file or folder with vendors they will be created.

If before your project is not used composer, connect the startup file vendors. To do this, enter the code in the project:

require 'path/to/vendor/autoload.php';

Example of work

class TestTask extends AsyncTask
{
    protected function onPreExecute()
    {
    }

    protected function doInBackground($parameters)
    {
        return $parameters;
    }

    protected function onPostExecute($result)
    {
        echo $result;
    }
}

$task = new TestTask();
$task->execute('test');

About

AsyncTask enables proper and easy use of the thread. This class allows to perform background operations and publish results on the thread without having to manipulate threads and/or handlers.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%