Ragex.Plugin.EventBus (Ragex v0.32.1)

View Source

Inter-plugin event broadcasting system for Ragex.

Allows plugins and core modules to publish lifecycle events (e.g. :file_indexed, :code_edited, :security_alert, :graph_mutated, :url_analyzed), which are automatically dispatched to registered plugins implementing the optional handle_event/2 callback.

Summary

Functions

Broadcasts an event asynchronously to all active plugins implementing handle_event/2.

Returns a specification to start this module under a supervisor.

Starts the EventBus GenServer.

Broadcasts an event synchronously to active plugins.

Functions

broadcast(event_name, payload \\ %{})

@spec broadcast(atom(), map()) :: :ok

Broadcasts an event asynchronously to all active plugins implementing handle_event/2.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts \\ [])

@spec start_link(keyword()) :: GenServer.on_start()

Starts the EventBus GenServer.

sync_broadcast(event_name, payload \\ %{})

@spec sync_broadcast(atom(), map()) :: {:ok, list()}

Broadcasts an event synchronously to active plugins.