swoole / rfc

Swoole 提案
116 stars 3 forks source link

Coroutines loosing parent's coroutine context #48

Closed pervozdanniy closed 5 years ago

pervozdanniy commented 5 years ago

Is it expected behavior that child coroutines looses parent's context on delay?

go(function() {
   $uid = \Co::getuid();
   go(function () use ($uid) {
      sleep(2);
      var_dump(\Co::getContext($uid));   //NULL
   });
});
matyhtf commented 5 years ago

goto https://github.com/swoole/swoole-src/issues/2463