PHPackages                             n-singularity/async - 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. n-singularity/async

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

n-singularity/async
===================

Asynchronous for Laravel

v1.1.0(6y ago)016MITPHPPHP &gt;=7CI failing

Since Dec 13Pushed 6y ago1 watchersCompare

[ Source](https://github.com/n-singularity/async)[ Packagist](https://packagist.org/packages/n-singularity/async)[ RSS](/packages/n-singularity-async/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

About
-----

[](#about)

this is a simple package for asynchronous laravel. Each task will be stored in the cache, and then will be executed in parallel with php artisan cli.

Setup
-----

[](#setup)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/):

```
composer require n-singularity/async

```

After updating composer, add the ServiceProvider to the providers array in `config/app.php`

```
Nsingularity\Async\AsynchronousServiceProvider::class

```

Basic Usage
-----------

[](#basic-usage)

This package supports three types of functions that can be run in parallel:

#### 1. Global Function

[](#1-global-function)

```
function sendEmail($email, $bodyEmail){
    //code to send email
}

function foo(){
    Nsingularity\Async\Async::globalFunction("sendEmail", ["email@example.com", "body email html"]);
    echo("done");
}
```

#### 2. Function of Object

[](#2-function-of-object)

```
class Example
{
    public function sendEmail($email, $bodyEmail){
        //code to send email

    }
}

function foo(){
    Nsingularity\Async\Async::objectFunction(new Example, "sendEmail", ["email@example.com", "body email html"]);
    echo("done");
}
```

#### 3. Object (must inplements AsyncableClassInterface)

[](#3-object-must-inplements-asyncableclassinterface)

```
class Example implements \Nsingularity\Async\AsyncableClassInterface
{
    private $email;

    private $bodyEmail;

    public function __construct($email, $bodyEmail){
        $this->email = $email;
        $this->bodyEmail = $bodyEmail;
    }

    public function handler(){
        //code to send email

    }
}

function foo(){
    Nsingularity\Async\Async::object(new Example("email@example.com", "body email html"));
    echo("done");
}
```

Get Response From Async
-----------------------

[](#get-response-from-async)

```
function createText($a, $b)
{
    sleep(5);
    return $a . " " . $b;
}

function foo(){
    $ts = time();
    $handler1 = Nsingularity\Async\Async::globalFunction("createText" ,["hello","world"]);
    $handler2 = Nsingularity\Async\Async::globalFunction("createText" ,["hello","hello"]);
    $handler3 = Nsingularity\Async\Async::globalFunction("createText" ,["world","world"]);

    $text1 = $handler1->get();
    $text2 = $handler2->get();
    $text3 = $handler3->get();

    $te = time();

    echo $text1." | ".$text2." | ".$text3." | ".$te-$ts; // hello world | hello hello | world world | 6
}
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~3 days

Total

2

Last Release

2342d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3880ba5c270804f7068cac7e6c0aa6a36db81f8d7adf5e81a201860405869d3a?d=identicon)[n-singularity](/maintainers/n-singularity)

---

Top Contributors

[![n-singularity](https://avatars.githubusercontent.com/u/13519541?v=4)](https://github.com/n-singularity "n-singularity (19 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/n-singularity-async/health.svg)

```
[![Health](https://phpackages.com/badges/n-singularity-async/health.svg)](https://phpackages.com/packages/n-singularity-async)
```

###  Alternatives

[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[propaganistas/laravel-disposable-email

Disposable email validator

5762.6M6](/packages/propaganistas-laravel-disposable-email)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)

PHPackages © 2026

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