com.github.thorbenkuck.keller.event.DispatcherStrategy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of keller-events Show documentation
Show all versions of keller-events Show documentation
Keller is a universal base-package
The newest version!
package com.github.thorbenkuck.keller.event;
import java.util.Collection;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public interface DispatcherStrategy {
static void applyDefault(final EventBus eventBus) {
final DispatcherStrategy dispatcherStrategy = new NativeDispatcherStrategy(eventBus);
eventBus.setDispatcherStrategy(dispatcherStrategy);
}
static void parallel(final EventBus eventBus) {
final DispatcherStrategy dispatcherStrategy = new NativeParallelDispatcherStrategy(eventBus);
eventBus.setDispatcherStrategy(dispatcherStrategy);
}
static void asynchronous(final EventBus eventBus) {
asynchronous(eventBus, Executors.newCachedThreadPool());
}
static void asynchronous(final EventBus eventBus, final ExecutorService threadPool) {
final DispatcherStrategy dispatcherStrategy = new NativeAsynchronousDispatcherStrategy(eventBus, threadPool);
eventBus.setDispatcherStrategy(dispatcherStrategy);
}
void dispatch(final Object event, final Collection bridges);
void dispatchDeadEvent(final DeadEvent deadEvent, final Collection bridges);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy