View Source Plausible.Cache.Warmer (Plausible v0.0.1)

A periodic cache warmer.

Child specification options available:

  • cache_impl - module expected to implement Plausible.Cache behaviour
  • interval - the number of milliseconds for each warm-up cycle
  • cache_name - defaults to cache_impl.name() but can be overridden for testing
  • force_start? - enforcess process startup for testing, even if it's barred by Plausible.Cache.enabled?. This is useful for avoiding issues with DB ownership and async tests.
  • warmer_fn - by convention, either :refresh_all or :refresh_updated_recently, both are automatically provided by cache_impl module. Technically any exported or captured function will work, if need be.

See tests for more comprehensive examples.

Summary

Functions

@spec child_spec(Keyword.t()) :: Supervisor.child_spec() | :ignore