Simple queue consumer framework that supports message dispatching.

dev-master 2022-05-17 18:27 UTC

This package is auto-updated.

Last update: 2022-08-17 19:02:22 UTC


Build Status


composer require crysalead/queue

Basic usage

Create Queue instance

$broker = new Lead\Queue\Adapter\Sqs(
    new SqsClient([
        'version' => 'latest',
        'region' => '<region>',
        'credentials' => [
            'key'=> '<key>',

Listen on queue

Listening is a blocking call and runs in an infinite loop (up to default 20s polling timout). Your callback will be triggered when a new Message has arrived.

$broker->listen(function($job) {

	if (!$job) {
	 *  Process the job...

	// Delete the job from Queue.


Shutting down the Queue

You may shutdown the queue by using the shutdown() method.

The Queue instance will respond to PCNTL signals in a safe manner that will not interrupt in the middle of Message processing. You can install signal handlers in your code to cleanly and safely shutdown the service.

	function() use ($broker) {



  • Syndicate (this repo is a simple fork of his brillant work).