asyncio: fix unreasonable return type of promise.Next()

This commit is contained in:
Li Jie
2024-08-05 15:21:14 +08:00
parent 3bf0780a67
commit 98072f3f4b
3 changed files with 103 additions and 68 deletions

View File

@@ -54,9 +54,8 @@ func (p *Promise[TOut]) Resume() {
coResume(p.hdl)
}
func (p *Promise[TOut]) Next() TOut {
func (p *Promise[TOut]) Next() {
coResume(p.hdl)
return p.value
}
// TODO(lijie): should merge to Yield()