pbergman/fifo

a php posix fifo (named pipes) wrapper to use for ipc

1.0.4 2016-05-31 18:58 UTC

This package is auto-updated.

Last update: 2024-11-29 13:13:13 UTC


README

FIFO (named pipes)

A simple wrapper around posix_mkfifo that can send signals and mixed data for ipc. Difference between signals and data is that data will verified and signal only will return the header (with pid and type) and the signal and is basically a stripped version of data to send integers.

###usage:

$object = new \stdClass();
$object->foo = 'bar';
$object->bar = 'foo';

$transport = new \PBergman\FIFO\Transport(posix_getpid());
$transport->write($object);
$transport->signal(SIGINT);

var_dump($transport->read()) // Will return $object;
var_dump($transport->read()) // Will return SIGINT;
var_dump($transport->read()) // Will return false;