View Source Handoff.ResourceTracker behaviour (Handoff v0.1.0)

Behavior for tracking and managing resources across nodes in the cluster.

This module is responsible for:

  • Registering nodes with their capabilities
  • Checking resource availability on nodes
  • Allocating resources for functions
  • Releasing resources when functions complete

Link to this section Summary

Callbacks

Check if the specified node has the required resources available.

Register a node with its capabilities.

Release resources back to the pool after function execution.

Request resources from a node for a function execution.

Link to this section Callbacks

@callback available?(node :: node(), req :: map()) :: boolean()

Check if the specified node has the required resources available.

parameters

Parameters

  • node: The node to check
  • req: Map of resource requirements to check
@callback register(node :: node(), caps :: map()) :: :ok

Register a node with its capabilities.

parameters

Parameters

  • node: The node to register
  • caps: Map of capabilities/resources the node provides
@callback release(node :: node(), req :: map()) :: :ok

Release resources back to the pool after function execution.

parameters

Parameters

  • node: The node to release resources on
  • req: Map of resources to release
@callback request(node :: node(), req :: map()) :: :ok | {:error, :resources_unavailable}

Request resources from a node for a function execution.

parameters

Parameters

  • node: The node to request resources from
  • req: Map of resource requirements