Comments (6)
that's right, @vixtor 。all the message execute in a single thread when the thread mode is async.you can custom the async event handler like this :
public class ThreadPoolHandler implements EventHandler {
ExecutorService mExecutorService = Executors.newFixedThreadPool(3);
EventHandler mHandler = new DefaultEventHandler();
@OverRide
public void handleEvent(final Subscription subscription, final Object event) {
mExecutorService.submit(new Runnable() {
@OverRide
public void run() {
mHandler.handleEvent(subscription, event);
}
});
}
}
and then set async event handler with EventBus.getDefault().setAsyncEventHandeler(new ThreadPoolHandler());
from androideventbus.
Thank you, this worked perfectly. If I may suggest, you could add this in the next version as ThreadMode.THREADPOOL or something similar.
from androideventbus.
That's great advice. We will consider putting it into our next version. I
am collecting apps which adopt AndroidEventBus and they will be put in
readme.md. Would it be too much to ask you to share with us your App name
and download link? Thank you!
2015-04-22 18:31 GMT+08:00 Viktor Kvaternjak [email protected]:
Thank you, this worked perfectly. If I may suggest, you could add this in
the next version as ThreadMode.THREADPOOL or something similar.—
Reply to this email directly or view it on GitHub
#11 (comment)
.
from androideventbus.
Sure, I will send it once it is finished and published.
from androideventbus.
Thank you very much![?]
2015-04-23 4:23 GMT+08:00 Viktor Kvaternjak [email protected]:
Sure, I will send it once it is finished and published.
—
Reply to this email directly or view it on GitHub
#11 (comment)
.
from androideventbus.
@vixtor hi,I am collecting apps which adopt AndroidEventBus and they will be put in
readme.md. Would it be too much to ask you to share with us your App name
and download link? Thank you!
from androideventbus.
Related Issues (20)
- 我发现在参数为List<T>的情况下会被调用2次 HOT 3
- 接收到数据后,界面无法更新
- 关于 @Subscriber(tag = "my_tag",mode = ThreadMode.POST) 接收不到消息 HOT 2
- EventBus 3.0 支持注解并且方法名无限制 HOT 2
- 使用jar收不到消息
- 出现错误
- 我使用eventbus传递点击事件,出现了订阅者执行俩次的问题 HOT 8
- 有没有设置优先级的方法啊
- AndroidEventBus的优化建议 HOT 1
- 针对README中“与greenrobot的EventBus的不同”的话题提出几点自己的看法↓↓↓ HOT 10
- 依赖生成 HOT 1
- 我的项目是分模块的 我发现无法在在模块间通讯
- 比如a模块一个页面 b模块一个页面 无法通讯
- 关于sticky事件的移除问题 HOT 1
- 在Android 4.4.4上找不到PersistableBundle
- 有人遇到eventbus重复接收的问题吗?我在系统7.0,8.0上会重复接收,但在6.0及以下是正常的,只有一次接收。 HOT 1
- 支持跨module通信吗 HOT 4
- poststick不起作用,原因是代码被注释了,请释放 HOT 3
- 一个接收方法同时接收多个tag的实现方案? HOT 1
- 比 EventBus 更高效的事件总线(BusUtils)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from androideventbus.