Search by

larahook / async-helper

Mishanki

Async call

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

This package is auto-updated.

Last update: 2026-09-14 08:36:45 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