Electric.Shapes.Monitor (electric v1.0.22)

View Source

Summary

Functions

Returns a specification to start this module under a supervisor.

Callback implementation for Supervisor.init/1.

Request a message when all readers of the given handle have finished or terminated.

clean up the state of a non-running consumer.

The number of active readers of all shapes.

The number of active readers of the given shape.

The number of active readers of all shapes.

Register the current process as a reader of the given shape.

Register the current process as a writer (consumer) of the given shape.

Unregister the current process as a reader of the given shape.

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.

init(opts)

Callback implementation for Supervisor.init/1.

name(stack_id)

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

@spec notify_reader_termination(stack_id(), shape_handle(), term(), pid()) :: :ok

Request a message when all readers of the given handle have finished or terminated.

Sends {Electric.Shapes.Monitor, :reader_termination, shape_handle, reason} to the registered pid when the reader count on a shape is 0.

purge_shape(stack_id, shape_handle, shape)

@spec purge_shape(stack_id(), shape_handle(), Electric.Shapes.Shape.t()) :: :ok

clean up the state of a non-running consumer.

reader_count(stack_id)

@spec reader_count(stack_id()) :: {:ok, non_neg_integer()}

The number of active readers of all shapes.

reader_count(stack_id, shape_handle)

@spec reader_count(stack_id(), shape_handle()) :: {:ok, non_neg_integer()}

The number of active readers of the given shape.

reader_count!(stack_id)

@spec reader_count!(stack_id()) :: non_neg_integer()

The number of active readers of all shapes.

register_reader(stack_id, shape_handle, pid \\ self())

@spec register_reader(stack_id(), shape_handle(), pid()) :: :ok

Register the current process as a reader of the given shape.

register_writer(stack_id, shape_handle, shape, pid \\ self())

Register the current process as a writer (consumer) of the given shape.

start_link(args)

unregister_reader(stack_id, shape_handle, pid \\ self())

@spec unregister_reader(stack_id(), shape_handle(), pid()) :: :ok

Unregister the current process as a reader of the given shape.