pbergman / fifo
a php posix fifo (named pipes) wrapper to use for ipc
Installs: 2 941
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 1
Open Issues: 0
Requires
- php: >=5.6.0
This package is auto-updated.
Last update: 2024-10-29 13:01:24 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;