public function dispatch(EventInterface $event, array $arguments = array(), CallbackInterface $onReadyCallback = null)
{
if (!$this->isReady) {
$this->addEvent($event, $arguments);
if ($onReadyCallback) {
$this->onReadyCallbacks[] = $onReadyCallback;
}
} else {
throw new \RuntimeException('Was already invoked!');
}
}