larahook/async-helper

Async call

Installs: 3

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/larahook/async-helper

v1.0.5 2026-01-14 07:07 UTC

This package is auto-updated.

Last update: 2026-01-14 07:08:01 UTC


README

Example

// Base code

echo 'a';

AsyncHelper::call(static function () {
    // Some async logic with separate database connection
    $response = Http::get('http://example.com/users');
    $data = $response->json();    
    foreach ($data as $userItem) {
       SomeUserModel::updateOrCreate($userItem);
    }

    echo 'c';
});

echo 'b';

// Result:
// 'a'
// 'b'
// 'c' // hidden echo