walkor / walkor/workerman

Using Swoole's eventLoopClass

Open
#720 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
11.6k
Forks
2.2k
Avg merge
11h 30m
Merged PRs (30d)
3

Description

Hello @walkor

What is exactly happening when I set `$eventLoopClass` to `Workerman\Events\Swoole` and use the following in `onMessage`? How come Swoole's coroutines working without issues ?! 🤔

```
$http_worker->onMessage = function ($connection, $request) {
Co\run(function()
{
swoole_coroutine_create(function()
{
Co::sleep(1);
echo "Done 1\n";
});

swoole_coroutine_create(function()
{
Co::sleep(1);
echo "Done 2\n";
});
});

// Send data to client
$connection->send("Hello World");
};
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.