Anvil.Queue.Policy behaviour (Anvil v0.1.1)
View SourceBehaviour for queue assignment policies.
Policies control how samples are assigned to labelers.
Summary
Functions
Initializes policy state based on the policy type.
Returns the next sample for a labeler based on the policy.
Updates the policy state after an assignment.
Types
Callbacks
@callback init(config :: map()) :: {:ok, policy_state()}
@callback next_assignment( policy_state(), labeler_id :: String.t(), available_samples :: [sample()] ) :: {:ok, sample()} | {:error, atom()}
@callback update_state(policy_state(), sample()) :: policy_state()
Functions
Initializes policy state based on the policy type.
Dispatches to the appropriate policy module.
Returns the next sample for a labeler based on the policy.
Dispatches to the appropriate policy module.
Updates the policy state after an assignment.