AttestoPhoenix.Store.ETSOwner (AttestoPhoenix v2.7.0)

Copy Markdown View Source

Lazily creates and owns the library's named ETS tables.

The owner is intentionally started without a link to its first caller. A request process must not be able to take down the owner and discard a table shared by all callers on the node.

Summary

Functions

Returns a specification to start this module under a supervisor.

Ensures that the named table exists with the caller-supplied options.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

ensure(table, options)

@spec ensure(atom(), [term()]) :: atom()

Ensures that the named table exists with the caller-supplied options.

Table creation runs in this singleton owner, so concurrent callers are serialized before :ets.new/2. The options remain with each store because they are part of that store's table contract.