bennidi / mbassador

Powerful event-bus optimized for high throughput in multi-threaded applications. Features: Sync and Async event publication, weak/strong references, event filtering, annotation driven
MIT License
958 stars 146 forks source link

No-arg constructor not allowed, contrary to example in documentation. #98

Closed basil-bourque closed 9 years ago

basil-bourque commented 9 years ago

The README.md shows an example with this no-argument constructor in mbassador 1.2.0:

MBassador<TestMessage> bus = new MBassador<TestMessage>();

An error appears in NetBeans 8.0.2 saying "constructor could not be applied", that an IBusConfiguration.

I could only get the following to work for instantiating the event bus where DataEvent is my own class (of course).

Member variable:

MBassador<DataEvent> eventBus;

Initializing code:

BusConfiguration busConfig = new BusConfiguration();
busConfig.addFeature( Feature.SyncPubSub.Default() );
busConfig.addFeature( Feature.AsynchronousHandlerInvocation.Default() );
busConfig.addFeature( Feature.AsynchronousMessageDispatch.Default() );
this.eventBus = new MBassador<>( busConfig );
ghost commented 9 years ago

You're correct. See #94.