Repository navigation
Replies: 5 comments 12 replies
|
ViaCoroutine 的主要用途是 co_await 用户自定义的 awaiter 时可以切换回来。 |
0 replies
SimpleExecutor e;
Lazy<void> bar() {}
Lazy<void> foo() {
co_await bar.via(&e); // 这个不属于用户定义的,但每次都要附带 `ViaCoroutine` 协程。
} |
0 replies
指的是非 Lazy 类型的其他 Awaiter |
0 replies
我的意思是像上面这种是否可以解决不需要附带 另,对于你说的非 Lazy 的 Awaiter, |
0 replies
RescheduleLazy 按设计其实本来只有 ReschduleLazy.start() 这种用法的,
无法判断其他 awaiter 中是否有 ex。如果你说判断 ex 是否非 null 的话,那本来就会判断吧。 |
12 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Search before asking
What happened + What you expected to happen
每次调用
RescheduleLazy为了恢复到调用前所在的上下文,会通过ViaAsyncAwaiter附带一个恢复的协程ViaCoroutine。这个恢复的协程的逻辑是否可以合并到
FinalAwaiter,避免需要多调用这个协程?Reproduction way
Anything else
Are you willing to submit a PR?
All reactions