Skip to content

Internals Events and Context

Stefan Crkvenjakov edited this page Oct 7, 2026 · 1 revision

Events and Context internals

Framework Internals · Developer guide

EventDispatcher stores listener arrays by event-name string. addListener appends, dispatch obtains IEvent::getName() and calls each listener's handle() in registration order, returning an array of result arrays. There is no priority, queued execution, listener discovery, cancellation or exception isolation. removeListeners deletes the entire name entry.

Context contains package path/name/string ID. GetContextEvent bundles the event object itself so RespondContextEvent can set its Context. Runtime activation replaces context.get listeners with a responder for the package; route execution adds the controller's responder. A freshly created GetContextEvent has no initialized context unless set/responded to, while ExceptionBase seeds a System fallback first.

VFS uses a separate ContextRequestEvent whose context field is set by ContextSwitchEvent. The executor replaces vfs.context.request listeners when main starts. These reserved names and mutable request-event patterns are implementation plumbing, not general package lifecycle notifications.

Built-in event names are package.installed, package.updated, route.dynamic.add, router.enter, renderer.ready, context.get and vfs.context.request. Exact payload definitions live in the event type references. Package events are sent after hooks; routing/rendering events bracket controller action/output processing.

Component reference

Clone this wiki locally