-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Him188/revise on demand scope #2645
Conversation
8c6e6fc
to
3bf371a
Compare
interesting |
基本好了
producer 抛异常不会立即 close channel, 在下一次 receiveOrNull 时才会 close.
在 BotAuth 时会最终以 TODO:
UPDATE: 留到第二个 PR 再做 |
b4b7667
to
b526df3
Compare
@Karlatemp 你想 review 吗 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没看具体实现, 看了一遍 test 感觉没啥问题, 实际登录测试过?
|
…job in constructor
also added delegations in mirai-core and mirai-core-api.
and rename OnDemandValueScope to OnDemandSendChannel and OnDemandReceiveChannel
[core] Start producer coroutine immediately on `expectMore` and yield Improve docs for OnDemandChannel Rename factory function `OnDemandReceiveChannel` to `OnDemandChannel` to better cover its meaning Create deferred lazily in Producing state Rename ProducerState to ChannelState fix atomicfu bug receiveOrNull Add docs (WIP, to be rebased) [core] OnDemandChannel: Catch Throwable in `receiveOrNull` to prevent possible failures
[core] OnDemandChannel: Ensure channel close and emit shares same behavior [core] OnDemandChannel: Ensure channel is closed properly when producer throws an exception [core] OnDemandChannel: Ensure coroutine scope cancelled when producer coroutine throws exception, also added more tests
…xception; add tests
60ce585
to
909985d
Compare
挪到 mirai-core-utils, 重新审查状态设计 (降低复杂度), 增加文档 (注释), 增加测试
close #2633