tailorlala / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

Allow AsyncEventBus to drain its queue #1817

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
As issue #1348 is not really going anywhere right now, I am trying to shut down 
an AsyncEventBus instance in a controlled manner (ensure that no new events are 
enqueued, make sure that all events in the queue get dispatched before shut 
down).

Right now, this is pretty hard and requires dancing around the black box that 
the event bus is 
(https://github.com/groupon/jesos/blob/master/src/main/java/com/groupon/mesos/ut
il/ManagedEventBus.java). 

It would be great to have a defined way to "shut down" an event bus so that it 
no longer accepts new events and also a way to ask it whether it is "fully 
drained" (No events in flight). 

As the current event bus code is all package private, the only way to actually 
implement it is to shim my code into the com.google package which seems to be 
weird. So consider this another vote to make EventBus and AsyncEventBus easily 
extendable.

Original issue reported on code.google.com by henn...@schmiedehausen.org on 25 Jul 2014 at 5:59

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<issue id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:08

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:17

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:07