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

线程切换问题 #1

Open
w290721955 opened this issue Sep 7, 2022 · 1 comment
Open

线程切换问题 #1

w290721955 opened this issue Sep 7, 2022 · 1 comment

Comments

@w290721955
Copy link

w290721955 commented Sep 7, 2022

我看对比图很多库都没加线程切换,不知道为啥,我自己用EventBus觉得线程切换还是很好用的,我们有时候希望在子线程发送,在主线程处理,有时候在子线程发送,在子线程处理(我看好像在子线程发送在主线程处理支持了,不知道在子线程发送在子线程处理支持没)。

@pengxurui
Copy link
Owner

目前市面上基于 LiveData 的事件总线不支持线程切换。我的规划是在 V2 版本中提供基于 Kotlin Flow 的 Bus,并且加强 ModularEventBus 对 Kotlin 协程的支持。在协程的支持下,相信线程切换的体验会比 EventBus 更好。另外,虽然目前 V1 不支持线程切换,但在收到事件后,用协程也还是可以很方便地切换到子线程的。可以期待一下 V2。

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