Raxol.Protocols.EventSystemIntegration (Raxol v2.0.1)

View Source

Integration layer between the existing event system and the new EventHandler protocol.

This module provides adapters and utilities to bridge the gap between the current event management system and the new protocol-based approach.

Summary

Functions

Add a handler to the event bus.

Create a unified event bus that can dispatch to protocol handlers.

Protocol-aware event dispatcher that can handle both protocol-implementing types and traditional event handlers.

Dispatch an event through the event bus to all registered handlers.

Create a middleware function for event filtering.

Create a middleware function for logging events.

Create a middleware function for performance monitoring.

Enhanced event manager that can work with protocol-implementing handlers.

Subscribe a protocol-implementing handler to multiple event types.

Functions

add_handler(bus, event_type, handler)

Add a handler to the event bus.

create_event_bus(opts \\ [])

Create a unified event bus that can dispatch to protocol handlers.

dispatch_event(target, event, state \\ %{})

Protocol-aware event dispatcher that can handle both protocol-implementing types and traditional event handlers.

dispatch_through_bus(bus, event)

Dispatch an event through the event bus to all registered handlers.

filtering_middleware(filter_fn)

Create a middleware function for event filtering.

logging_middleware(opts \\ [])

Create a middleware function for logging events.

performance_middleware(opts \\ [])

Create a middleware function for performance monitoring.

register_handler(event_type, handler)

Enhanced event manager that can work with protocol-implementing handlers.

subscribe_handler(handler, event_types)

Subscribe a protocol-implementing handler to multiple event types.