Differences between Greenrobot EventBus and Guava's EventBus
Asked Answered
K

4

17

I´ve been using quite often EventBus from greenrobot

https://github.com/greenrobot/EventBus

But I´ve just realised that Guava has its own EventBus

com.google.common.eventbus.EventBus

Does someone know if there are big differences?

Kalie answered 8/2, 2016 at 11:14 Comment(4)
Just to be clear, com.google.common.eventbus.EventBus is not a part of Android. It's from Guava, a set of Java libraries mostly developed by Google. So both of these are extra libraries you'd have to include in your app.Wulf
Agree with that. are there big differences between one or another? which one is preferible to use?Kalie
I've only used the greenrobot version so I'm not sure, sorry!Wulf
Me too, that´s why I was wondering if it was worth to use the Google one, although so far the Greenboot works perfectlyKalie
M
17

Both are excellent quality library.

Here is a comparison (from greenrobot developpers point of view) between greenrobot EventBus and Otto (a fork from Guava specialized for android).

I personnaly like EventBus because it support delivery in background threads

Monteiro answered 8/2, 2016 at 13:11 Comment(0)
P
8

No more need to compare where otto is deprecated and writes a note:

This project is deprecated in favor of RxJava and RxAndroid.

Pickup answered 31/12, 2016 at 6:40 Comment(0)
S
2

EventBus can do some Android specific tricks, which other implementations don't support. First, there is main thread support to conveniently switch threads.Second its performance was optimized especially for Android. For example, with EventBus 3 you get annotations without the performance downgrade you would have with Otto or Guava.

Sitting answered 12/2, 2016 at 14:13 Comment(0)
E
0

Otto is deprecated in favor of RxJava and RxAndroid.

RxJava 1.x is end-of-life as of March 31, 2018.

Use RxJava 2.x, I guess.

Etruscan answered 6/9, 2018 at 14:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.