preparing message bus
This commit is contained in:
@@ -10,7 +10,13 @@ public class MessageBus {
|
||||
private MessageBus(){}
|
||||
|
||||
public void dispatch(Event event){
|
||||
listeners.parallelStream().forEach(l -> l.onEvent(event));
|
||||
new Thread(() -> { // TODO: use thread pool
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
listeners.parallelStream().forEach(l -> l.onEvent(event));
|
||||
} catch (InterruptedException ignored) {
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
public void drop(EventListener listener){
|
||||
|
||||
Reference in New Issue
Block a user