hibiken/asynq#105 (comment) hibiken/asynq#105 (comment)
https://github.com/hibiken/asynq Asynq is a Go library for queueing tasks and processing them asynchronously with workers. It's backed by Redis and is designed to be scalable yet easy to get started.
"php": "^8.1",
"ext-redis": "^5.3",
composer require wuwuseo/hibiken-asynq-client:dev-main
use Client to put tasks on queues.
example
namespace Wuwuseo\HibikenAsynqClient\Tests;
use Ramsey\Uuid\Uuid;
use Wuwuseo\HibikenAsynqClient\Client;
class ClientTest extends \PHPUnit\Framework\TestCase
{
public function testEnqueue()
{
$redis = new \Redis();
$redis->connect('127.0.0.1');
$clinet = new Client($redis);
$res = $clinet->Enqueue([
'typename'=>'newtest:user:xxxx',
'payload'=>[
'test'=>'xxxx',
'user'=>1111
],
'opts'=>[
'timeout'=>0,
]
],[
'queue'=>'test'
]);
$this->assertTrue($res);
}
}