Electric.ShapeCache (electric v1.4.11)
View SourceSummary
Functions
Returns a specification to start this module under a supervisor.
Types
@type handle_position() :: {shape_handle(), current_snapshot_offset :: Electric.Replication.LogOffset.t()}
@type shape_def() :: Electric.Shapes.Shape.t()
@type shape_handle() :: Electric.shape_handle()
@type stack_id() :: Electric.stack_id()
Functions
@spec await_snapshot_start(shape_handle(), stack_id(), non_neg_integer()) :: :started | {:error, term()}
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec clean_shape(shape_handle(), stack_id()) :: :ok
@spec count_shapes(stack_id()) :: non_neg_integer() | :error
@spec fetch_handle_by_shape(shape_def(), stack_id()) :: {:ok, shape_handle()} | :error
@spec fetch_shape_by_handle(shape_handle(), stack_id()) :: {:ok, Electric.Shapes.Shape.t()} | :error
@spec get_or_create_shape_handle(shape_def(), stack_id(), opts :: Access.t()) :: handle_position()
@spec has_shape?(shape_handle(), Access.t()) :: boolean()
@spec list_shapes(stack_id()) :: [{shape_handle(), Electric.Shapes.Shape.t()}] | :error
@spec resolve_shape_handle(shape_handle(), shape_def(), stack_id()) :: handle_position() | nil
@spec start_consumer_for_handle(shape_handle(), stack_id()) :: {:ok, pid()} | {:error, :no_shape}