CentralStationRuntime constructor

CentralStationRuntime({
  1. required Map<Type, CommandHandler> commandHandlers,
  2. required List<EventHandler> eventHandlers,
})

Implementation

CentralStationRuntime({
  required this.commandHandlers,
  required this.eventHandlers,
}) {
  // setup current runtime in event handlers
  eventHandlers.forEach((evh) {
    evh.runtime = this;
  });
  // for event dispatching
  _eventBus.on().listen((event) {
    _dispatch(event);
  });
}