Skip to content

线程切换问题 #1

Open
Open

Description

@w290721955

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

Activity

  1. pengxurui commented on Sep 8, 2022

    @pengxurui
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions