2017 © Pedro Peláez
 

library event-ivey

Simple event and queue system with extensibility through adapters

image

gdecris/event-ivey

Simple event and queue system with extensibility through adapters

  • Sunday, October 15, 2017
  • by gdecris
  • Repository
  • 1 Watchers
  • 2 Stars
  • 262 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 19 Versions
  • 6 % Grown

The README.md

event-ivey

PHP Event System with queue driver support, (*1)

Setup using illuminate/container

  // Register the appropriate queue
  $container->singleton(QueueContract::class, MemoryQueue::class);
  // Bind the dispatcher as a singleton
  $container->singleton(EventDispatcher::class);

Basic Usage

Listen to events

  $container->make(EventDispatcher::class)->listen('event.name', function($payload) {
    // Listener receives the payload
  });

Fire events

  $container->make(EventDispatcher::class)->fire('event.name', ['some' => 'payload data']);

Queued Listener

Registering the Listener

  $container->make(EventDispatcher::class)->listen('event.name', MyListener::class);

Listener class

  use Ivey\Events\EventListener;

  class MyListener extends EventListener 
  {
      proteceted static $should_queue = true;

      public function fire($payload)
      {
          // TODO: Implement fire() method.
      }
  }

Worker

Running the worker

  $worker = $container->make(Worker::class);


  // Sleep for 5 seconds retry a max of 3 times before failing
  $worker->setSleep(5)
      ->setTries(3)
      ->runDaemon();

Failed jobs

  // Add a listener for catching the failed jobs so you can handle them accordingly
  $container->make(EventDispatcher::class)->listen('failed.job', function ($payload) {

  });

The Versions

15/10 2017

dev-master

9999999-dev

Simple event and queue system with extensibility through adapters

  Sources   Download

MIT

The Requires

 

The Development Requires

15/10 2017

v1.0.2

1.0.2.0

Simple event and queue system with extensibility through adapters

  Sources   Download

MIT

The Requires

 

The Development Requires

15/06 2017

v1.0.1

1.0.1.0

Simple event and queue system with extensibility through adapters

  Sources   Download

MIT

The Requires

 

The Development Requires

15/06 2017

v1.0.0

1.0.0.0

Simple event and queue system with extensibility through adapters

  Sources   Download

MIT

The Requires

 

The Development Requires

06/01 2017

v0.7.14

0.7.14.0

Simple event and queue system with extensibility through adapters

  Sources   Download

MIT

The Requires

 

The Development Requires

06/01 2017

v0.7.13

0.7.13.0

Simple event and queue system with extensibility through adapters

  Sources   Download

MIT

The Requires

 

The Development Requires

22/12 2016

v0.7.12

0.7.12.0

Simple event and queue system with extensibility through adapters

  Sources   Download

MIT

The Requires

 

The Development Requires

22/12 2016

v0.7.11

0.7.11.0

Simple event and queue system with extensibility through adapters

  Sources   Download

MIT

The Requires

 

The Development Requires

22/12 2016

v0.7.10

0.7.10.0

Simple event and queue system with extensibility through adapters

  Sources   Download

MIT

The Requires

 

The Development Requires

19/10 2016

v0.7.9

0.7.9.0

Simple event and queue system with extensibility through adapters

  Sources   Download

MIT

The Requires

 

The Development Requires

14/10 2016

v0.7.8

0.7.8.0

Simple event and queue system with extensibility through adapters

  Sources   Download

MIT

The Requires

 

The Development Requires

12/10 2016

v0.7.7

0.7.7.0

Simple event and queue system with extensibility through adapters

  Sources   Download

MIT

The Requires

 

The Development Requires

12/10 2016

v0.7.6

0.7.6.0

Simple event and queue system with extensibility through adapters

  Sources   Download

MIT

The Requires

 

The Development Requires

12/10 2016

v0.7.5

0.7.5.0

Simple event and queue system with extensibility through adapters

  Sources   Download

MIT

The Requires

 

The Development Requires

12/10 2016

v0.7.4

0.7.4.0

Simple event and queue system with extensibility through adapters

  Sources   Download

MIT

The Requires

 

The Development Requires

12/10 2016

v0.7.3

0.7.3.0

Simple event and queue system with extensibility through adapters

  Sources   Download

MIT

The Requires

 

11/10 2016

v0.7.2

0.7.2.0

Simple event and queue system with extensibility through adapters

  Sources   Download

MIT

The Requires

 

11/10 2016

v0.7.0

0.7.0.0

Simple event and queue system with extensibility through adapters

  Sources   Download

MIT

The Requires

 

11/10 2016

v0.7.1

0.7.1.0

Simple event and queue system with extensibility through adapters

  Sources   Download

MIT

The Requires