2017 © Pedro Peláez
 

library ensign

PHPinnacle Signal Dispatcher

image

phpinnacle/ensign

PHPinnacle Signal Dispatcher

  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 71 % Grown

The README.md

PHPinnacle Ensign

Latest Version on Packagist ![Software License][ico-license] Coverage Status ![Quality Score][ico-code-quality] Total Downloads, (*1)

PHPinnacle Ensign provides tools that allow your application components to communicate with each other by dispatching signals and listening to them., (*2)

Thanks to amphp backend those communication is fully asynchronous., (*3)

Install

Via Composer, (*4)

$ composer require phpinnacle/ensign

Basic Usage

<?php

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

use PHPinnacle\Ensign\DispatcherBuilder;

Amp\Loop::run(function () {
    $builder = new DispatcherBuilder;
    $builder
        ->register('upper', function (string $text) {
            return \strtoupper($text);
        })
        ->register('lower', function (string $text) {
            return \strtolower($text);
        })
    ;

    $dispatcher = $builder->build();

    $hello = yield $dispatcher->dispatch('upper', 'hello');
    $world = yield $dispatcher->dispatch('lower', 'WORLD');

    echo sprintf('%s %s!', $hello, $world);
});

More examples can be found in examples directory., (*5)

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*6)

Security

If you discover any security related issues, please email dev@phpinnacle.com instead of using the issue tracker., (*7)

Credits

License

The MIT License (MIT). Please see License File for more information., (*8)

The Versions

04/07 2018

dev-master

9999999-dev https://github.com/phpinnacle/ensign

PHPinnacle Signal Dispatcher

  Sources   Download

MIT

The Requires

 

The Development Requires

async phpinnacle signal dispatcher

14/04 2018

dev-experimentals

dev-experimentals https://github.com/phpinnacle/ensign

PHPinnacle Signal Dispatcher

  Sources   Download

MIT

The Requires

 

The Development Requires

async phpinnacle signal dispatcher