-
-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Labels
bugSomething isn't workingSomething isn't workingnew featureNew feature or requestNew feature or request
Description
When using React\Async\await somewhere and then returning the response as a promise (e.g. a promise got from React\Http\Browser::get(), in the example it's replaced by a simple resolve($response)), an assertion in the \FrameworkX\Io\FiberHandler (line 49: assert($response instanceof ResponseInterface);) will fail. After removing this assertion it seems to work fine.
Returning the promise without any React\Async\await before does not reveal this.
#!/usr/bin/env php
<?php
declare(strict_types=1);
use function React\Async\await;
use function React\Promise\resolve;
use function React\Promise\Timer\sleep;
require __DIR__ . '/../vendor/autoload.php';
$app = new FrameworkX\App();
$app->get('/', function () {
await(sleep(3));
$response = React\Http\Message\Response::plaintext(
"Hello world!\n",
);
return resolve($response);
});
$app->run();clue
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingnew featureNew feature or requestNew feature or request