2017 © Pedro PelĂĄez
 

library queue

Queue abstraction library

image

pekkis/queue

Queue abstraction library

  • Friday, March 4, 2016
  • by pekkis
  • Repository
  • 2 Watchers
  • 17 Stars
  • 64,296 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 6 Forks
  • 1 Open issues
  • 24 Versions
  • 4 % Grown

The README.md

Pekkis Queue

Build Status, (*1)

A small, opinionated queue abstraction library based on discovered needs. Extracted from Xi Filelib and other assorted projects., (*2)

What does it do?

A message consists of a topic and arbitrary data (basic serializable data supported by default, custom serializers can be added). Messages are moved and grooved through a queue. The library extracts a simple, 80/20 like domain for it's method of operation and abstracts away the differences in message queue backends., (*3)

Status

The project is purely in maintenance mode. I have "moved on" since, code mostly JS & React these days., (*4)

If you want to maintain this, holler!, (*5)

Quickstart

<?php

namespace Pekkis\Queue\Example;

use Pekkis\Queue\Adapter\IronMQAdapter;
use Pekkis\Queue\Message;
use Pekkis\Queue\Queue;

require_once (is_file(__DIR__ . '/bootstrap.php')) ? __DIR__ . '/bootstrap.php' : __DIR__ . '/bootstrap.dist.php';

// Create a new IronMQ backed queue
$queue = new Queue(
    new IronMQAdapter(IRONMQ_TOKEN, IRONMQ_PROJECT_ID, 'pekkis-queue-example')
);

// Queues can be emptied.
$queue->purge();

// A message consists of a topic and data. A message instance with an UUID you can use is returned.
$message = $queue->enqueue(
    'pekkis.queue.example',
    array(
        'some' => 'random data'
    )
);

// Dequeue and process a single message
$received = $queue->dequeue();
$data = $received->getData();
var_dump($data);

// Acknowledge the message (you're done with it)
$queue->ack($received);

A better example

For an end-to-end example with IronMQ and a "real life" scenario, see the folder examples., (*6)

Also see Xi Filelib (v0.10+) for actual real use case from the real world!, (*7)

Ideas / wishes? Contact or create a pull request! Cheers!, (*8)

Supported queues

  • RabbitMQ (via PECL and pure PHP).
  • IronMQ
  • Amazon SQS

Version upgrades

Refer to the change log, (*9)

The Versions

12/02 2014
02/02 2014

v0.3.3

0.3.3.0 http://github.com/pekkis/queue

Queue abstraction library

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

queue message queue

02/02 2014

v0.3.2

0.3.2.0 http://github.com/pekkis/queue

Queue abstraction library

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

queue message queue

29/01 2014

v0.3.1

0.3.1.0 http://github.com/pekkis/queue

Queue abstraction library

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

queue message queue

29/01 2014

v0.3.0

0.3.0.0 http://github.com/pekkis/queue

Queue abstraction library

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

queue message queue

28/01 2014

v0.2.0

0.2.0.0 http://github.com/pekkis/queue

Queue abstraction library

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

queue message queue

26/01 2014

v0.1.1

0.1.1.0 http://github.com/pekkis/queue

Queue abstraction library

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

queue message queue

26/01 2014

v0.1.0

0.1.0.0 http://github.com/pekkis/queue

Queue abstraction library

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

queue message queue