Explicit seam for resolving and bounding tenant scope across runtime helpers.
Summary
Types
Callbacks
@callback resolve_tenant(conn_or_socket_or_params :: term()) :: tenant_scope()
@callback same_tenant?(a :: tenant_scope(), b :: tenant_scope()) :: boolean()
@callback tenant_topic(base_topic :: String.t(), tenant :: tenant_scope()) :: String.t()
Functions
@spec module() :: module()
@spec normalize_tenant(term()) :: tenant_scope()
@spec resolve_tenant(term()) :: tenant_scope()
@spec same_tenant?(tenant_scope(), tenant_scope()) :: boolean()
@spec tenant_topic(String.t(), tenant_scope()) :: String.t()