View Source Handoff.ResultStore (Handoff v0.1.0)

Provides storage and retrieval of function execution results and cached arguments.

Maintains an ETS table for fast access to results and cached arguments by ID. The store can also fetch data from remote nodes when needed using the DataLocationRegistry.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Clears all stored values for a specific DAG.

Fetches a value from a remote node and stores it locally for a specific DAG.

Retrieves a value by its ID from the local store for a specific DAG.

Retrieves a value, fetching it from a remote node if necessary for a specific DAG.

Checks if a value exists for the given ID in a specific DAG.

Stores the result of a function execution or caches an argument for a specific DAG.

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Clears all stored values for a specific DAG.

parameters

Parameters

  • dag_id: The ID of the DAG whose results to clear
Link to this function

fetch_remote(dag_id, id, from_node \\ nil)

View Source

Fetches a value from a remote node and stores it locally for a specific DAG.

parameters

Parameters

  • dag_id: The ID of the DAG
  • id: The ID of the value to fetch
  • from_node: Specific node to fetch from, or nil to look up in registry

returns

Returns

  • {:ok, value} if successfully fetched
  • {:error, reason} if fetch failed

Retrieves a value by its ID from the local store for a specific DAG.

parameters

Parameters

  • dag_id: The ID of the DAG
  • id: The ID of the value to retrieve

returns

Returns

  • {:ok, value} if the value is found
  • {:error, :not_found} if no value exists for the ID in the given DAG
Link to this function

get_with_fetch(dag_id, id, from_node \\ nil)

View Source

Retrieves a value, fetching it from a remote node if necessary for a specific DAG.

parameters

Parameters

  • dag_id: The ID of the DAG
  • id: The ID of the value to retrieve
  • from_node: Optional node to fetch from directly

returns

Returns

  • {:ok, value} if the value is found or successfully fetched
  • {:error, :not_found} if the value couldn't be found
  • {:error, reason} for other errors

Checks if a value exists for the given ID in a specific DAG.

parameters

Parameters

  • dag_id: The ID of the DAG
  • id: The ID to check

returns

Returns

  • true if a value exists
  • false otherwise
Link to this function

store(dag_id, id, value)

View Source

Stores the result of a function execution or caches an argument for a specific DAG.

parameters

Parameters

  • dag_id: The ID of the DAG
  • id: The ID of the function result or argument
  • value: The value to store