Skip to content

Commit eb0a79a

Browse files
committed
Add streaming example
1 parent b284cca commit eb0a79a

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

examples/stream.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
require __DIR__ . '/../vendor/autoload.php';
4+
5+
use React\EventLoop\Factory as LoopFactory;
6+
use Clue\React\Docker\Factory;
7+
8+
$image = isset($argv[1]) ? $argv[1] : 'clue/redis-benchmark';
9+
10+
$loop = LoopFactory::create();
11+
12+
$factory = new Factory($loop);
13+
$client = $factory->createClient();
14+
15+
$client->imageCreate($image)->then(
16+
function ($response) {
17+
echo 'response: '; var_dump($response);
18+
},
19+
'var_dump',
20+
function ($info) {
21+
echo 'update: ' . json_encode($info) . PHP_EOL;
22+
}
23+
);
24+
25+
$loop->run();

0 commit comments

Comments
 (0)