View Source Hyperliquid.Cache.Warmer (hyperliquid v0.2.2)

GenServer for async cache initialization with retry logic.

Uses handle_continue/2 pattern for non-blocking startup - the supervision tree completes immediately while cache initialization happens in the background.

Features

  • Non-blocking startup: Application starts immediately regardless of API availability
  • Partial failure handling: Some cache keys may succeed while others fail
  • Automatic retry: Failed initialization retries with configurable backoff
  • Status introspection: Check initialization status via initialized?/0 and status/0

Usage

The Warmer is started automatically by the supervision tree when autostart_cache is true. You can check its status:

Hyperliquid.Cache.Warmer.initialized?()
# => true or false

Hyperliquid.Cache.Warmer.status()
# => %{initialized: true, retry_count: 0, last_error: nil}

Summary

Functions

Returns a specification to start this module under a supervisor.

Returns whether the cache has been successfully initialized.

Starts the Cache Warmer GenServer.

Returns the full status of the warmer for debugging.

Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Returns whether the cache has been successfully initialized.

Example

Hyperliquid.Cache.Warmer.initialized?()
# => true

Starts the Cache Warmer GenServer.

Returns the full status of the warmer for debugging.

Example

Hyperliquid.Cache.Warmer.status()
# => %{initialized: true, retry_count: 0, last_error: nil}