preparing message bus

This commit is contained in:
2025-12-19 08:42:47 +01:00
parent a924f25f51
commit 73751c1ea2
8 changed files with 70 additions and 11 deletions

View File

@@ -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){