View Source Nexlm.Providers.Stub.Store (Nexlm v0.1.15)
Per-owner response store backing the stub provider.
Stubs are registered against the process that enqueues them, and any
descendant process (via OTP's :$ancestors chain) automatically resolves the
same owner entry. State lives in an ETS table keyed by owner pid so async
tests stay isolated while still supporting multi-process flows.
Summary
Types
@type model_name() :: String.t()
Functions
@spec clear() :: :ok
@spec next_response(model_name(), Nexlm.Config.t(), map()) :: {:ok, map()} | {:error, Nexlm.Error.t()}
@spec put(model_name(), map() | tuple() | response_fun()) :: :ok
@spec put_sequence(model_name(), [map() | tuple() | response_fun()]) :: :ok
@spec with_stub(model_name(), map() | tuple() | response_fun(), (-> result)) :: result when result: var