diff options
author | Wolfy-J <[email protected]> | 2018-01-23 19:51:15 -0500 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-01-23 19:51:15 -0500 |
commit | 78a42de837928cf7d10a1ae04d7e82e56d66e1e2 (patch) | |
tree | 8882b9a051bcc9c42328df583c0bb8c39a89591e /tests/slow-client.php | |
parent | fa4bd78d9f7c5f74e8445374370927c742fc4e78 (diff) |
API update
Diffstat (limited to 'tests/slow-client.php')
-rw-r--r-- | tests/slow-client.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/slow-client.php b/tests/slow-client.php new file mode 100644 index 00000000..f09142b5 --- /dev/null +++ b/tests/slow-client.php @@ -0,0 +1,38 @@ +<?php + +use Spiral\Goridge; + +ini_set('display_errors', 'stderr'); +require dirname(__DIR__) . "/vendor/autoload.php"; + +if (count($argv) < 3) { + die("need 2 arguments"); +} + +list($test, $goridge, $bootDelay, $shutdownDelay) = [$argv[1], $argv[2], $argv[3], $argv[4]]; + +switch ($goridge) { + case "pipes": + $relay = new Goridge\StreamRelay(STDIN, STDOUT); + break; + + case "tcp": + $relay = new Goridge\SocketRelay("localhost", 9007); + break; + + case "unix": + $relay = new Goridge\SocketRelay( + "sock.unix", + null, + Goridge\SocketRelay::SOCK_UNIX + ); + + break; + + default: + die("invalid protocol selection"); +} + +usleep($bootDelay * 1000); +require_once sprintf("%s/%s.php", __DIR__, $test); +usleep($shutdownDelay * 1000);
\ No newline at end of file |