2017 © Pedro Peláez
 

library stream-process

Wrapper around proc_open to ease communication via streams between processes

image

christiaan/stream-process

Wrapper around proc_open to ease communication via streams between processes

  • Saturday, July 7, 2018
  • by christiaan
  • Repository
  • 1 Watchers
  • 3 Stars
  • 11,057 Installations
  • PHP
  • 1 Dependents
  • 1 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

StreamProcess

Build Status, (*1)

Easily spawn processes and communicate with them using streams. Mainly build to be used together with react/event-loop., (*2)

Installation

composer.phar require christiaan/stream-process

Usage

$loop = \React\EventLoop\Factory::create();

$child = new StreamProcess('php someWorkerProcess.php');

$loop->addReadStream($child->getReadStream(), function($stream) {
        $data = fgets($stream);
        fwrite(STDOUT, $data);
    });

$loop->addPeriodicTimer(1, function() {
        pcntl_signal_dispatch();
    });


pcntl_signal(SIGTERM, function() use($loop) {
        $loop->stop();
        // Cleanup before closing
        exit(0);
    });


fwrite($child->getWriteStream(), 'start');
$loop->run();

Known issues

Not working on Windows because of this bug, (*3)

Could possible be fixed by using files instead of direct streams., (*4)

The Versions

07/07 2018

dev-master

9999999-dev

Wrapper around proc_open to ease communication via streams between processes

  Sources   Download

MIT

The Requires

  • php >= 5.3.2

 

The Development Requires

by Christiaan Baartse

process stream react event-loop proc_open

07/07 2018

1.0.2

1.0.2.0

Wrapper around proc_open to ease communication via streams between processes

  Sources   Download

MIT

The Requires

  • php >= 5.3.2

 

The Development Requires

by Christiaan Baartse

process stream react event-loop proc_open

27/03 2013

1.0.1

1.0.1.0

Wrapper around proc_open to ease communication via streams between processes

  Sources   Download

MIT

The Requires

  • php >= 5.3.2

 

The Development Requires

by Christiaan Baartse

process stream react event-loop proc_open

07/03 2013

1.0.0

1.0.0.0

Wrapper around proc_open to ease communication via streams between processes

  Sources   Download

MIT

The Requires

  • php >= 5.3.2

 

The Development Requires

by Christiaan Baartse

process stream react event-loop proc_open