Replies: 2 comments
-
Hey @arashnz, thanks for bringing this up 👍 I'm not sure if I completely understand the problem you're having, as a start I would suggest to take a look at the coroutine documentation in https://github.com/reactphp/async# Taken from this documentation, here's an example of using React\Async\coroutine(function () {
$browser = new React\Http\Browser();
try {
$response = yield $browser->get('https://example.com/');
assert($response instanceof Psr\Http\Message\ResponseInterface);
echo $response->getBody();
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage() . PHP_EOL;
}
}); If this doesn't help you to progress, please come back to this conversation and provide some more information like:
By providing us with this information, we can better understand your problem and give you a helpful solution! 👍 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
hello,
how can i use yield keyword inside React\EventLoop\Loop::get() and new Connector($loop)?
it just don't work when i use yield inside it
Beta Was this translation helpful? Give feedback.
All reactions