Electric.Shapes.Consumer.Materializer (electric v1.4.13)

View Source

Summary

Functions

Returns a specification to start this module under a supervisor.

Removes the cached link values for shape_handle from the shared ETS table. Safe to call even if the table does not exist (e.g. after a stack shutdown).

Returns the current set of materialized link values for a shape. Checks the shared ETS cache first (written after each committed transaction); falls back to a synchronous GenServer call if the cache has no entry yet.

Get a stream of log entries from storage, bounded by the subscribed offset.

Callback implementation for GenServer.init/1.

Creates the per-stack ETS table that caches link values for all materializers in a stack. Called by ConsumerRegistry during stack initialization. Idempotent — safe to call when the table already exists.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get_all_as_refs(shape, stack_id)

get_stream_up_to_offset(min_offset, subscribed_offset, storage)

Get a stream of log entries from storage, bounded by the subscribed offset.

The subscribed_offset is the Consumer's latest_offset at the time of subscription. We only read up to this offset to avoid duplicates - any changes after this offset will be delivered via new_changes messages from the Consumer.

handle_continue(arg1, state)

Callback implementation for GenServer.handle_continue/2.

init(opts)

Callback implementation for GenServer.init/1.

name(map)

name(stack_id, shape_handle)

new_changes(state, changes, opts \\ [])

start_link(opts)

subscribe(pid)

subscribe(stack_id, shape_handle)

wait_until_ready(state)

whereis(map)

whereis(stack_id, shape_handle)