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

Behavior for allocating functions to nodes based on resource requirements.

This module is responsible for determining which nodes should execute which functions, considering their resource requirements and available capabilities.

Link to this section Summary

Callbacks

Allocate functions to nodes based on resource requirements and node capabilities.

Link to this section Callbacks

Link to this callback

allocate(functions, caps)

View Source
@callback allocate(
  functions :: [Handoff.Function.t()],
  caps :: %{required(node()) => map()}
) :: %{required(term()) => node()}

Allocate functions to nodes based on resource requirements and node capabilities.

parameters

Parameters

  • functions: List of functions to allocate
  • caps: Map of node capabilities in the format %{node() => capabilities_map}

returns

Returns

A map with function IDs as keys and node assignments as values.