This package is abandoned and no longer maintained. No replacement package was suggested.

Very Simple Queue.

Maintainers

Details

github.com/Wandu/Q

Source

v4.0.0-beta2 2017-07-11 09:07 UTC

README

Latest Stable Version Latest Unstable Version Total Downloads License

Very Simple Queue.

Installation

composer require wandu/q

Usage

Sender

use Wandu\Q\Adapter\SqsAdapter;
use Wandu\Q\Queue;
use Wandu\Q\Serializer\JsonSerializer;

$sender = new Queue(new JsonSerializer(), new SqsAdapter(
    'xxxxxxxxxxxx', // key
    'xxxxxxxxxxxx', // secret
    'ap-northeast-1', // region
    'https://sqs.ap-northeast-1.amazonaws.com/000000000000/queue-name' // queue url
));
$sender->enqueue([
    'body' => 'kkk',
    '333' => 'halelleknflaksdf',
]);

Receiver

use Wandu\Q\Adapter\SqsAdapter;
use Wandu\Q\Queue;
use Wandu\Q\Serializer\JsonSerializer;

$sender = new Queue(new JsonSerializer(), new SqsAdapter(
    'xxxxxxxxxxxx', // key
    'xxxxxxxxxxxx', // secret
    'ap-northeast-1', // region
    'https://sqs.ap-northeast-1.amazonaws.com/000000000000/queue-name' // queue url
));
while (true) {
    $job = $sender->dequeue();
    if ($job) {
        print_r($job->read());
        $job->delete();
    }
    sleep(3);
}

Websites