Skip to content

wuwuseo/hibiken-asynq-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hibiken-asynq-client

This is a client for the hibiken/asynq GO task queue used to send asynq tasks in PHP.

Asynq issues Client in other languages

hibiken/asynq#105 (comment) hibiken/asynq#105 (comment)

Asynq

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.

required

"php": "^8.1",
"ext-redis": "^5.3",

install

composer require wuwuseo/hibiken-asynq-client:dev-main

used

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);
    }
}

About

This is a client for the hibiken/asynq GO task queue used to send asynq tasks in PHP.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages