Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.
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

Description

@vinaya-procore

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions