Current section
Files
Jump to
Current section
Files
lib/rig/rate_limit/table_owner.ex
defmodule Rig.RateLimit.TableOwner do
@moduledoc """
Keeps the ETS table alive.
An ETS table always links to a process lifecycle. This process stays alive
so the table doesn't go away.
"""
use GenServer
require Logger
def start_link do
GenServer.start_link(__MODULE__, :ok, name: __MODULE__)
end
@impl GenServer
def handle_info({:"ETS-TRANSFER", table_name, _from_pid, _args}, state) do
Logger.debug("Accepting transfer of ETS table #{inspect table_name}")
{:noreply, state}
end
end