PHPackages                             dmamontov/asynctask - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dmamontov/asynctask

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

dmamontov/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.

1.0.5(10y ago)572.3k6[2 issues](https://github.com/dmamontov/asynctask/issues)BSD-3-ClausePHPPHP &gt;=5.3.3

Since Apr 18Pushed 7y ago11 watchersCompare

[ Source](https://github.com/dmamontov/asynctask)[ Packagist](https://packagist.org/packages/dmamontov/asynctask)[ Docs](http://www.slobel.ru/)[ RSS](/packages/dmamontov-asynctask/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

[![Build Status](https://camo.githubusercontent.com/3e39c5b6262029efe132f5db3b4d93e47c69e16ae4d1583f7f9461c98087d964/68747470733a2f2f7472617669732d63692e6f72672f646d616d6f6e746f762f6173796e637461736b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dmamontov/asynctask)[![Latest Stable Version](https://camo.githubusercontent.com/611afe386551757a46c1dfb7c2b1565fce20d4a166ab2993c3e81ae779a786c7/68747470733a2f2f706f7365722e707567782e6f72672f646d616d6f6e746f762f6173796e637461736b2f762f737461626c652e737667)](https://packagist.org/packages/dmamontov/asynctask)[![License](https://camo.githubusercontent.com/a60d4330063aba04efaa314773d627f4ebbae9c5517bde30c7dcc26d709bc810/68747470733a2f2f706f7365722e707567782e6f72672f646d616d6f6e746f762f6173796e637461736b2f6c6963656e73652e737667)](https://packagist.org/packages/dmamontov/asynctask)[![Total Downloads](https://camo.githubusercontent.com/c5096d8905395c629a6d71eb22132710099333707fa0cb84a327e1743e6a6513/68747470733a2f2f706f7365722e707567782e6f72672f646d616d6f6e746f762f6173796e637461736b2f646f776e6c6f616473)](https://packagist.org/packages/dmamontov/asynctask)[![PHP Classes](https://camo.githubusercontent.com/8b4a94a79f43f44687b40e0a91a226a5b6d929b69cba415d01253b2343065bf0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d636c61737365732d626c75652e737667)](http://www.phpclasses.org/package/9047-PHP-Execute-asynchronous-tasks-in-the-background.html)

OBSOLETE. The current class is available at the following [link](https://github.com/dmamontov/asynctask-7).
-----------------------------------------------------------------------------------------------------------

[](#obsolete-the-current-class-is-available-at-the-following-link)

AsyncTask
=========

[](#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](https://dmamontov.github.io/asynctask).

Requirements
------------

[](#requirements)

- PHP version ~5.3.3
- Module installed pcntl and posix
- All functions pcntl, posix and shm removed from the directive disable\_functions

Installation
------------

[](#installation)

1. Install [composer](https://getcomposer.org/download/)
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

[](#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');
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 98.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~17 days

Total

4

Last Release

3994d ago

PHP version history (2 changes)1.0.2PHP &gt;=5.3.3

1.0.3PHP &gt;=5.3.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5955726?v=4)[Dmitry Mamontov](/maintainers/dmamontov)[@dmamontov](https://github.com/dmamontov)

---

Top Contributors

[![dmamontov](https://avatars.githubusercontent.com/u/5955726?v=4)](https://github.com/dmamontov "dmamontov (51 commits)")[![amoogi](https://avatars.githubusercontent.com/u/142491?v=4)](https://github.com/amoogi "amoogi (1 commits)")

---

Tags

asynchronoustaskbackgroundwork days

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dmamontov-asynctask/health.svg)

```
[![Health](https://phpackages.com/badges/dmamontov-asynctask/health.svg)](https://phpackages.com/packages/dmamontov-asynctask)
```

###  Alternatives

[react/react

ReactPHP: Event-driven, non-blocking I/O with PHP.

9.1k3.6M63](/packages/react-react)[react/event-loop

ReactPHP's core reactor event loop that libraries can use for evented I/O.

1.3k139.6M664](/packages/react-event-loop)[phing/phing

PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant.

1.2k21.7M876](/packages/phing-phing)[dmamontov/asynctask-7

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.

1313.1k](/packages/dmamontov-asynctask-7)[cocur/background-process

Start processes in the background that continue running when the PHP process exists.

2971.9M12](/packages/cocur-background-process)[laravel-admin-ext/scheduling

Task scheduling extension for laravel-admin

93247.1k6](/packages/laravel-admin-ext-scheduling)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
