Electric.Shapes.Monitor.RefCounter (electric v1.0.24)

View Source

Tracks active uses of shapes, the number of readers (and their pids) and the active writer.

Allows for registering callback messages when all readers of a shape have terminated or when some other process has terminated.

Uses Electric.Shapes.Monitor.CleanupTaskSupervisor to trigger an unsafe_cleanup! of shape storage once the shape supervisor has terminated.

See Electric.Shapes.Monitor for usage.

Summary

Types

shape_handle()

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

stack_id()

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

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

name(opts_or_stack_id)

notify_reader_termination(stack_id, shape_handle, reason, pid \\ self())

purge_shape(stack_id, shape_handle, shape)

start_link(opts)