Skip to content

Instantly share code, notes, and snippets.

@Ferreiramg
Last active August 29, 2015 14:10
Show Gist options
  • Save Ferreiramg/aac2d75a7ddf34b8839e to your computer and use it in GitHub Desktop.
Save Ferreiramg/aac2d75a7ddf34b8839e to your computer and use it in GitHub Desktop.
<?php
require_once __DIR__ . '/vendor/autoload.php';
$client= popen('ping localhost' , 'w');
stream_set_blocking($client, 0);
$loop = React\EventLoop\Factory::create();
$conn = new React\Socket\Connection($client, $loop);
$conn->pipe(new React\Stream\Stream(STDOUT, $loop));
$loop->run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment