View Source Jellyfish.Cache (Jellyfish v0.2.4)

Provides process-dictionary-based caching for hot upgrade operations.

This module manages ephemeral state during the build process to track which applications and dependencies have been processed for appup generation and copying. The cache is scoped to the current Mix process and does not persist across builds.

Use Cases

  • Deduplication: Ensures appup files are generated only once per dependency
  • Version Tracking: Stores application version information for use across build tasks
  • Build Coordination: Coordinates state between GenAppup and CopyAppup tasks

Summary

Functions

Checks if this is the first time copying appup files for a library.

Checks if this is the first time generating appup files for a library.

Retrieves application information from the cache.

Stores application version information in the process cache.

Functions

Link to this function

first_run_copy_appup?(lib)

View Source
@spec first_run_copy_appup?(atom()) :: boolean()

Checks if this is the first time copying appup files for a library.

Similar to first_run_gen_appup?/1, but tracks the copy operation separately. This allows the build process to coordinate generation and copying as distinct phases.

Link to this function

first_run_gen_appup?(lib)

View Source
@spec first_run_gen_appup?(atom()) :: boolean()

Checks if this is the first time generating appup files for a library.

This function uses a boolean flag to track whether appup generation has been triggered for a specific library. The first call returns true and sets the flag to false, ensuring subsequent calls return false.

@spec get_app(atom() | String.t()) :: %{version: String.t()} | nil

Retrieves application information from the cache.

Returns the data previously stored via store_app_version/2, or nil if no data exists for the given application.

Link to this function

store_app_version(app, version)

View Source
@spec store_app_version(atom() | String.t(), String.t()) :: %{version: String.t()}

Stores application version information in the process cache.

The version is stored as a map with a :version key, allowing for future extension with additional metadata if needed.