Statsig.DataStore behaviour (statsig_elixir v0.16.3)
Behaviour and helper APIs for implementing a custom Statsig data store in Elixir.
A data store implementation is a module that implements the callbacks in this behaviour.
Use start_link/3 to launch the bridge process and pass the returned
%Statsig.DataStore.Reference{} into Statsig.Options.
Summary
Functions
Starts a bridge process for the provided implementation module.
Stops the bridge process for the given reference.
Types
@type state() :: term()
Opaque state returned from user callbacks.
Callbacks
Functions
@spec start_link(module(), term(), Keyword.t()) :: {:ok, Statsig.DataStore.Reference.t()} | {:error, term()}
Starts a bridge process for the provided implementation module.
Returns {:ok, %Statsig.DataStore.Reference{}} which can be assigned to
%Statsig.Options{data_store: reference}.
@spec stop(Statsig.DataStore.Reference.t(), term(), non_neg_integer()) :: :ok
Stops the bridge process for the given reference.