Closed bramus closed 4 years ago
This package may not support coroutines. Please close the coroutines and use synchronous blocking to execute them.
$server = new Swoole\HTTP\Server("0.0.0.0", 9501);
$server->set(['enable_coroutine' => false']);
$server->on('start', function (Swoole\Server $server){
echo "Server Started with Manager PID {$server->manager_pid} and Master PID {$server->master_pid}" . PHP_EOL;
});
Hi @bramus, did @matyhtf suggestion work for you? I'm having the same issue.
Thanks
Im having the same issue when connecting GRPC for AxonServer. Any ideas?
The thing is, if I use plain PHP without swoole server (same docker instance) its connects and I can push messages, but when I use it from a slimple swoole instance it keeps hanging on the connection. Hope this helps.
Im having the same issue when connecting GRPC for AxonServer. Any ideas?
Try this:
grpc.enable_fork_support = 1
3. Disable opcahce
`opcache.enable_cli=0`
4.
Please answer these questions before submitting your issue. Thanks!
What did you do? If possible, provide a simple script for reproducing the error.
I have a
\Swoole\HTTP\Server
instance that handles HTTP requests.At a certain moment – inside
onRequest
– I am trying to store data into Google Cloud Firestore, using thegoogle/cloud-firestore
package. That package communicates to the Google servers over port 443., internally using the PHP gRPC extension.Here's the (slimmed down) code, which is no more than a basic
\Swoole\HTTP\Server
implementation:What did you expect to see?
That, upon receiving a request through Swoole's
$server
, the Firestore Document were to be created + data would be set + the$name
would beecho
d.What did you see instead?
The code just hangs upon the
$document->set
call and does nothing anymore.When moving the whole Firestore logic to outside of
$server->on('request', …)
it works just fine. When moving the whole Firestore logic to inside$server->on('start', …)
it works just fine.It's only in
$server->on('request', …)
that it does not work.What version of Swoole are you using (show your
php --ri swoole
)?What is your machine environment used (including version of kernel & php & gcc) ?
I'm running macOS 10.15.3 with PHP 7.4.2