Raxol.Payments.Checkpoint.ETS (Raxol Payments v0.2.0)

Copy Markdown View Source

ETS-backed Raxol.Payments.Checkpoint store.

The table is :public so any process can read and write it, and it is owned by whichever process calls new/1. For the recovery this checkpoint exists to provide, that owner must outlive the agent it protects: a table owned by the crashing agent dies with it. Create it from a supervisor-level process (the cockpit, a DynamicSupervisor, or the application) so an in-flight record survives the agent's restart.

This survives a process crash, not a VM restart. Back the same behaviour with DETS or a database when cross-restart durability is required.

Summary

Functions

Create a table and return the {module, handle} store to put in the context.

Functions

new(name \\ nil)

@spec new(atom() | nil) :: Raxol.Payments.Checkpoint.store()

Create a table and return the {module, handle} store to put in the context.

Pass a name for a named table (convenient to address and assert on in tests); omit it for an anonymous table addressed by its returned reference.