For regular events (ie with only a few presenters), I agree with
Dennis. I'd rather configure it thanks to the event bus to easily
control the event flow.
However this feature could be really useful in the case described by
Jeff (where you want to add other handlers without modifying the event
bus) and also if you want to broadcast an event to a lot of handlers.
We could also extend this feature to child module: if a child module
extends the interface, then the event will be automatically forwarded
to it:
@Events(....)
@ChildModules(@ChildModule(moduleClass=SomeChildModule.class),...)
public interface SomeEventBus extends EventBus{
@Event(implementedBy=SomeInterface.class)
void someEvent(...);
}
public interface SomeInterface {
//I don't think it's necessary to define the handling method here
since the framework will verify that each handler defines the right
method
//at compilation time. Also without this method, we can extend it to
child module
}
public interface SomeChildModule extends Mvp4gModule, SomeInterface {
//this mean that SomeChildModule will need an event bus with the
someEvent method
}
What do you think?
Thanks,
Pierre
ps: like for any new feature, don't hesitate to star it to prioritize
it. Also any help is appreciated so if you ever come up with a patch
to fix this issue, let me know. Thanks.
> > > will become more readable.- Hide quoted text -
>
> - Show quoted text -