Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

协程Future\co,yield偶发返回promise对象。 #144

Open
newinternetboy opened this issue Feb 23, 2021 · 2 comments
Open

协程Future\co,yield偶发返回promise对象。 #144

newinternetboy opened this issue Feb 23, 2021 · 2 comments

Comments

@newinternetboy
Copy link

文档中说
yield 关键字在这里的作用就是,可以等待调用完成并返回 promise 所包含的值
但是在实际上运行上,yield偶发返回promise对象。

@newinternetboy newinternetboy changed the title 协程Future\co 协程Future\co,yield偶发返回promise对象。 Feb 23, 2021
@andot
Copy link
Member

andot commented Feb 24, 2021

有没有可以复现这个问题的例子

@newinternetboy
Copy link
Author

嗯~这个目前也是偶现的,我这边开发复现的概率比较高,目前是做了兼容处理
$co_yield = yield $collection_co_result; if(is_object($co_yield)) { $co_yield = $co_yield->getValue(); } $collection_list = unserialize($co_yield);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants