Packages

RIG, the Reactive Interaction Gateway, provides an easy (and scaleable) way to push messages from backend services to connected frontends (and vice versa).

Current section

Files

Jump to
rig lib rig rate_limit table_owner.ex
Raw

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