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

RFC-1012 Server->taskwait 支持协程调度 #28

Closed
matyhtf opened this issue Jul 7, 2018 · 0 comments
Closed

RFC-1012 Server->taskwait 支持协程调度 #28

matyhtf opened this issue Jul 7, 2018 · 0 comments

Comments

@matyhtf
Copy link
Member

matyhtf commented Jul 7, 2018

现状

目前Server->taskwait是阻塞等待 TaskWorker返回数据的。在协程版本中,可以基于协程调度来实现非阻塞。

  • 需要注意兼容enable_coroutine => false的情况,这种情况下无法使用协程调度器

实现

  • 投递taskyield让出当前协程,使用task_id作为key保存协程上下文
  • onFinish时,根据task_id找到对应的协程,并恢复执行
@matyhtf matyhtf added the 草案 draft label Jul 7, 2018
@matyhtf matyhtf changed the title Server->taskwait 支持协程调度 RFC-1012 Server->taskwait 支持协程调度 Aug 3, 2018
@matyhtf matyhtf closed this as completed Aug 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant