View Source Chord.Cleanup.Server (Chord v0.2.0)
Periodic cleanup server for stale contexts and deltas.
This server periodically triggers the cleanup logic defined in Chord.Cleanup,
removing stale entries from the backend.
State
The server's state includes:
:interval- The interval (in milliseconds) between cleanup executions.:backend_opts- A keyword list of options passed to backend listing functions.
Example
Chord.Cleanup.Server.start_link(interval: :timer.minutes(30), backend_opts: [limit: 100])
Summary
Functions
Returns a specification to start this module under a supervisor.
Starts the cleanup server with the specified options.
Updates the backend options for periodic cleanup at runtime.
Updates the interval for periodic cleanup at runtime.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Starts the cleanup server with the specified options.
Options
:interval(integer): Time interval in milliseconds for periodic cleanup (default: 1 hour).:backend_opts(Keyword.t): Options passed to backend listing functions (see "Common Options" in theChordmodule).
Example
iex> Chord.Cleanup.Server.start_link(interval: :timer.minutes(30), backend_opts: [limit: 50])
{:ok, pid}
Updates the backend options for periodic cleanup at runtime.
Parameters
new_opts(Keyword.t): The new backend options.name(atom): The name of theGenServerinstance. Defaults to__MODULE__.
Returns
:okif the backend options were successfully updated.
Updates the interval for periodic cleanup at runtime.
Parameters
new_interval(integer): The new interval in milliseconds.name(atom): The name of theGenServerinstance. Defaults to__MODULE__.
Returns
:okif the interval was successfully updated.