Exact.TokenStore.ETS (exact_online v0.1.0)

Copy Markdown View Source

In-memory Exact.TokenStore backed by a named ETS table.

The table is created on first write, so nothing has to be added to your supervision tree. Tokens are lost when the owning process dies, which makes this a good fit for scripts, Livebook and tests, and a poor fit for a long-running app: a restart forces every user to authorize again. Use a persistent store in production.

Locking uses :global.trans/2, which serializes refreshes across the whole cluster for a given key.

Summary

Functions

Removes the token stored under key.

Stores token under key, creating the table if needed.

Functions

delete(key)

@spec delete(Exact.TokenStore.key()) :: :ok

Removes the token stored under key.

put(key, token)

Stores token under key, creating the table if needed.