I moved $eventLoopClass initialization process out from getter to new initGlobalEvent method.
Also I added condition whether $eventLoopClass implements EventInterface or not. If not, process exits immediately with message. Previously in this situation process hangs with loop flooding exceptions.
I also suggest redirecting all exceptions thrown in runAll method to the log.
I moved $eventLoopClass initialization process out from getter to new initGlobalEvent method.
Also I added condition whether $eventLoopClass implements EventInterface or not. If not, process exits immediately with message. Previously in this situation process hangs with loop flooding exceptions.
I also suggest redirecting all exceptions thrown in runAll method to the log.