Electric.ShapeCache (electric v1.4.11)

View Source

Summary

Types

handle_position()

@type handle_position() ::
  {shape_handle(),
   current_snapshot_offset :: Electric.Replication.LogOffset.t()}

shape_def()

@type shape_def() :: Electric.Shapes.Shape.t()

shape_handle()

@type shape_handle() :: Electric.shape_handle()

stack_id()

@type stack_id() :: Electric.stack_id()

Functions

activate_mocked_functions_from_test_process()

await_snapshot_start(shape_handle, stack_id, attempts_remaining \\ 10)

@spec await_snapshot_start(shape_handle(), stack_id(), non_neg_integer()) ::
  :started | {:error, term()}

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

clean_shape(shape_handle, stack_id)

@spec clean_shape(shape_handle(), stack_id()) :: :ok

count_shapes(stack_id)

@spec count_shapes(stack_id()) :: non_neg_integer() | :error

fetch_handle_by_shape(shape, stack_id)

@spec fetch_handle_by_shape(shape_def(), stack_id()) :: {:ok, shape_handle()} | :error

fetch_shape_by_handle(handle, stack_id)

@spec fetch_shape_by_handle(shape_handle(), stack_id()) ::
  {:ok, Electric.Shapes.Shape.t()} | :error

get_or_create_shape_handle(shape, stack_id, opts \\ [])

@spec get_or_create_shape_handle(shape_def(), stack_id(), opts :: Access.t()) ::
  handle_position()

has_shape?(shape_handle, stack_id)

@spec has_shape?(shape_handle(), Access.t()) :: boolean()

list_shapes(stack_id)

@spec list_shapes(stack_id()) ::
  [{shape_handle(), Electric.Shapes.Shape.t()}] | :error

name(stack_ref)

resolve_shape_handle(shape_handle, shape, stack_id)

@spec resolve_shape_handle(shape_handle(), shape_def(), stack_id()) ::
  handle_position() | nil

start_consumer_for_handle(shape_handle, stack_id)

@spec start_consumer_for_handle(shape_handle(), stack_id()) ::
  {:ok, pid()} | {:error, :no_shape}

start_link(opts)