2017 © Pedro Peláez
 

library dispatcher

flux style dispatcher

image

ionophp/dispatcher

flux style dispatcher

  • Saturday, December 24, 2016
  • by ytake
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Iono\Dispatcher

Build Status Codacy Badge Coverage Status Scrutinizer Code Quality, (*1)

StyleCI SensioLabsInsight, (*2)

PHP flux pattern dispatcher library(facebook style)
Dispatcher is used to broadcast payloads to registered callbacks
pub-sub style, (*3)

install

the package to your composer.json and run composer update., (*4)

"require": {
    "php": ">=7.0.0",
    "ionophp/dispatcher": "0.*"
},

usage

instance

require __DIR__ . "/../vendor/autoload.php";

$dispatcher = new \Iono\Dispatcher\Dispatcher();

register

$id = $dispatcher->register(
    function ($payload) {
        return $payload["actionoType"];
    }
);

dispatch the payload

$dispatcher->dispatch([
    "actionType" => 'update',
]);

unregister

$id = $dispatcher->register(
    function () {
        return "testing";
    }
);
$dispatcher->unregister($id);

The Versions

24/12 2016

dev-master

9999999-dev

flux style dispatcher

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

by Yuuki Takezawa

dispatcher