More examples and tweaks
* Signal dispatch() method now uses own pid as default value * SharedData now updates checksum cache on set()
This commit is contained in:
16
examples/channels.php
Normal file
16
examples/channels.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__."/../vendor/autoload.php";
|
||||
|
||||
use NoccyLabs\Ipc\Interop\Channel\StreamChannel;
|
||||
|
||||
// Create a pair of channels.
|
||||
[ $ch1, $ch2 ] = StreamChannel::createPair();
|
||||
|
||||
// Send messages with send()
|
||||
$ch1->send([
|
||||
'msg' => "Hello World"
|
||||
]);
|
||||
|
||||
// Receive at the other end using receive()
|
||||
print_r($ch2->receive());
|
Reference in New Issue
Block a user