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

Post events delayed #70

Open
alosdev opened this issue Mar 14, 2014 · 7 comments
Open

Post events delayed #70

alosdev opened this issue Mar 14, 2014 · 7 comments

Comments

@alosdev
Copy link

alosdev commented Mar 14, 2014

It would be nice, if it is possible so send events with a delay and the possibility to cancel them

@jnagels
Copy link
Contributor

jnagels commented Jun 5, 2014

You can build around this by using android.os.Handler.postDelayed()

@alosdev
Copy link
Author

alosdev commented Jun 6, 2014

yeah, you can do this, but it can be handy if it is implemented in the frame work :)

@greenrobot
Copy link
Owner

With canceling you are referring to cancel delayed events, that were yet not send?

@alosdev
Copy link
Author

alosdev commented Jun 6, 2014

yes

@metc
Copy link

metc commented Jul 14, 2016

As proposed in the issue #193, I think delayed events would be useful.
As an example, let's say I use an asynchronous API. I start a request and then I wait for the the asynchronous response. The operation can take some time or never return if an error occurs.

In the API response callback, I generate an event with the result, but this operation can take some time. An idea would be to send a delayed event when making the API request and use it as a timeout. If I receive the response event before the delayed event, this means an error occurred and it should be possible to cancel the delayed event (like sticky events).

Is something do you plan to implement ? If no, which alternative could you propose to schedule timeouts and cancel them with ease ?

@greenrobot-team
Copy link
Collaborator

@metc You might want to have a look at RxJava. -ut

@ramiws
Copy link

ramiws commented Jan 28, 2018

Now that Eventbus is not only for Android, it is good idea to have post delayed solution that works on Android and 'normal' Java (server) apps. In my case, I have shared Eventbus code between the two, which mean two ugly impl as a work around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants