Slither.Bridge.ViewRegistry (Slither v0.1.0)

Copy Markdown View Source

ETS-backed registry mapping session IDs to registered view callback IDs.

Tracks which SnakeBridge callbacks belong to which Slither session so they can be cleaned up when a session ends.

Summary

Functions

Returns a specification to start this module under a supervisor.

Remove all registrations for a session.

Get all callback registrations for a session.

Register a view callback for a session (or :global).

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

clear_session(scope)

@spec clear_session(binary() | :global) :: :ok

Remove all registrations for a session.

get_session_callbacks(scope)

@spec get_session_callbacks(binary() | :global) :: [{atom(), binary()}]

Get all callback registrations for a session.

register(scope, view_name, callback_id)

@spec register(binary() | :global, atom(), binary()) :: :ok

Register a view callback for a session (or :global).

start_link(opts \\ [])