Remove PayloadInterface, add README

This commit is contained in:
joopschilder committed 2020-02-08 22:09:11 +01:00
1 parent 6a7ea39f5c
commit 4edc6132c4
10 files changed
+234 -93

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
<?php
use JoopSchilder\React\Stream\NonBlockingInput\ReadableNonBlockingInputStream;
use React\EventLoop\Factory;
require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/demo_classes.php';
$input = new DemoJokeGenerator();
$loop = Factory::create();
$stream = new ReadableNonBlockingInputStream($input, $loop);
$stream->on('data', fn(Joke $joke) => print($joke . PHP_EOL));
$loop->addPeriodicTimer(0.2, fn() => print('.' . PHP_EOL));
$loop->run();