-
Notifications
You must be signed in to change notification settings - Fork 131
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
Eventbus - allow custom scopes in eventbus addon #289
Comments
Hi again, I needed a solution, so I put together a hack. I implemented a ViewEventBus, which is pausable. With this, I can set all registered listeners to paused when I open a modal window and set them to play again, when the window is closed... seems a bit dirty, but it does the job for now. Here is my implementation if anyone has a similar problem: PausableViewEventBus.java
PausableMethodListenerWrapper.java
PausableMethodListenerWrapper.java
|
Thanks for your input. I'll have a look at what could be done to support other scopes in the future. Unfortunately I've been busy with other projects so it might take a while. |
Hi, thanks for the great add on.
I'm using the eventbus addon and stumbled upon an issue. I had the need for modal windows in my application, since I didn't want a view-change in that case, I created my own custom scope SingleModalWindowScope. I'm still testing, but it seems to do the job.
My problem is now, that I reuse views, in the modal window, which use the ViewEventBus. Now if a event is fired, possibly both, the view in the background and the modal window are listing to it.
I checked the eventbus code and I guess I could implement my own ScopedEventBus, but I wouldn't be able to use it with the current API because of the EventScope enum, which only allows the predefined scopes. Do you see any problems with e.g. giving the EventScope enum a field for the scope-name and allowing
<T> void publish(EventScope scope, String topic, Object sender, T payload) throws UnsupportedOperationException;
to overload for instance a newly introduced method
<T> void publish(String scopeName, String topic, Object sender, T payload) throws UnsupportedOperationException;
I didn't analyze the whole code, do you see any other problems with allowing custom scopes in the eventbus?
Thanks!
BR Florian
The text was updated successfully, but these errors were encountered: