This repository was archived by the owner on Mar 19, 2021. It is now read-only.
Support shutdown schedule for the Sqlitex.Server process after inactivity #91
Open
Description
Having a long running Sqlitex.Server
process is awesome. What if I have N number of sqlite files in my project, and I want to start a process per file. Since I will have N processes running, I will want any process that has not been queried for a certain time, say 10 minutes, to be automatically shutdown.
Something like:
def init({state, timeout}) do
Process.send_after(self(), :shutdown, timeout)
{:ok, []}
end
def handle_info(:shutdown, _state) do
exit(:normal)
{:noreply, []}
end
Thanks
Metadata
Metadata
Assignees
Labels
No labels