SyncFlash: document :public ETS table option

This commit is contained in:
Moritz 2026-02-23 19:21:19 +01:00
parent 6c22d889a1
commit ede3df12ef
Signed by: moritz
GPG key ID: 1020A035E5DD0824

View file

@ -35,6 +35,8 @@ defmodule Mv.Vereinfacht.SyncFlash do
@doc false @doc false
def create_table! do def create_table! do
# :public so any process can write (SyncContact runs in LiveView/Ash transaction process,
# not the process that created the table). :protected would restrict writes to the creating process.
if :ets.whereis(@table) == :undefined do if :ets.whereis(@table) == :undefined do
:ets.new(@table, [:set, :public, :named_table]) :ets.new(@table, [:set, :public, :named_table])
end end