GithubHelp home page GithubHelp logo

Comments (5)

LowLowCoder-Mel avatar LowLowCoder-Mel commented on May 23, 2024

我目前使用 kotlin mvvm 架构, 利用协程来处理 RxBus 事件, 使用时 数据处理使用后台协程(Dispatchers.IO)处理, 然后ui部分采用 ui 协程 (Dispatchers.Main)

from rxbus.

joimxjtuse avatar joimxjtuse commented on May 23, 2024

我目前使用 kotlin mvvm 架构, 利用协程来处理 RxBus 事件, 使用时 数据处理使用后台协程(Dispatchers.IO)处理, 然后ui部分采用 ui 协程 (Dispatchers.Main)

我没刻意关注耗时在subscribe / 线程切换(好像 我的case都是发生在ui线程,不存在线程切换) / oberver 具体哪个地方 ,我个人的场景是 瞬时间大量的task 加入到 flowable内。

我没了解 kotlin的协程是怎么 实现的, 根据协程的原理,只是将多个任务让一个线程去处理(我的理解对吗?), 那如果 瞬时间有多个click任务 加入到事件队列里面是否 会有执行延迟, 疑惑卡顿严重的饿问题呢??

@zhang632615 , 不知道 您那边 有 用 rxbus去 划分业务层吗, 比如click事件都使用事件(以结偶fragmenty、activity的关联),这时候是否体验依然很不错呢?

from rxbus.

joimxjtuse avatar joimxjtuse commented on May 23, 2024

我现在的项目 是个新项目 ,所以 使用rxbus来隔离的业务层,开始效果不错,也基本达到来拥抱变化的效果,但是 随着业务的庞大, 性能问题暴露的饿挺明显的, 所以我非常不建议使用rxbus来结偶业务层 ,虽然我目前没有找到 比较好的办法证明,但是 我将部分业务功能 切换回visitor模式的实现,体验有较明显的提高。

from rxbus.

joimxjtuse avatar joimxjtuse commented on May 23, 2024

我现在的项目 是个新项目 ,所以 使用rxbus来隔离的业务层,开始效果不错,也基本达到来拥抱变化的效果,但是 随着业务的庞大, 性能问题暴露的饿挺明显的, 所以我非常不建议使用rxbus来结偶业务层 ,虽然我目前没有找到 比较好的办法证明,但是 我将部分业务功能 切换回visitor模式的实现,体验有较明显的提高。

我说的“结偶业务层” 是指 把f2a,f2f里 甚至click事件的所有可能有引起耦合的逻辑都使用事件驱动。

from rxbus.

hwangjr avatar hwangjr commented on May 23, 2024

能否提供一个demo?或者将ANR日志提供下。我看下。另外,依赖看是否要升级,欢迎 pull request。

from rxbus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.