Mathieu Ledru

Results 12 comments of Mathieu Ledru

Hi ! This is an unfinished PR but some tests pass. I choose to contribute because I liked the video about coroutine : https://www.youtube.com/watch?v=7TvIIt4c8uY And there is some hype about...

> The main point is that they do not expose any concept of Promise, and it makes things harder. You PR propose a complete Promise implementation (A+ style), but I...

Usage with [Coroutine Yield](https://www.swoole.co.uk/docs/modules/swoole-coroutine-yield) and [Coroutine Resume](https://www.swoole.co.uk/docs/modules/swoole-coroutine-resume) is interesting too. A good implementation usage can be found in [Barrier](https://github.com/swoole/library/blob/master/src/core/Coroutine/Barrier.php)

I won't recommend [Co\run](https://www.swoole.co.uk/docs/modules/swoole-coroutine-run) as this this involve `Swoole\Coroutine\Scheduler` and there are no `stop()` method, but only `run()`. May try with `Coroutine::create` only (Co\go is the alias function)

This seem's working `php examples/00--swooleSimpleWait.php` Also 'ABCABA' work too `php examples/00--swooleABCABA.php`

I integrated your stuff into a new EventLoop and will see how we can go so far.

`bin/phpunit tests/Adapter/Swoole/EventLoopTest.php --filter testIdle` `bin/phpunit tests/Adapter/Swoole/EventLoopTest.php --filter testDelay` pass ✅

Current status lot of ✅ ``` bin/phpunit tests/Adapter/Swoole/EventLoopTest.php Tests: 40, Assertions: 49, Errors: 4, Failures: 4. ```

> I followed your recommendation to **not** use `Co\run` and it works like a charm! Here my code, and I added a `promiseAll` function using `WaitGroup`. I feel this is...

The reason why I ended with `EventLoop->shiftCoroutine` promise is the fact that I can have a fine granular control on the execution order of Swoole coroutine. If I take your...