Skip to main content

Module patterns

Module patterns 

Source
Expand description

§Coordination Patterns

Reusable multi-agent patterns for common coordination scenarios. These patterns abstract away the mechanics of distributing work, collecting results, and handling failures across multiple fighters.

Structs§

ChainHandler
A handler in the chain of responsibility.
MapReduceConfig
Configuration for a MapReduce operation.
MapReduceResult
Result of a MapReduce operation.
ScatterResponse
A response from a scatter-gather participant.
SupervisedWorker
State of a supervised worker.
SupervisorConfig
Configuration for the supervisor pattern.

Functions§

auction_filter_bids
Filter bids to only include those that meet a minimum confidence threshold.
auction_select_winner
Run an auction: collect bids from fighters and select the winner.
chain_find_handler
Determine which handler in the chain should handle a task.
chain_walk
Walk the chain: each handler decides if it can handle, else passes along.
execute_auction
Execute the auction pattern: announce a task to all capable fighters, collect bids, and award the task to the best bidder.
execute_chain_of_responsibility
Execute the chain of responsibility pattern by sending the task through handlers until one processes it. Each handler is asked via messaging whether it can handle the task (based on capabilities). The first capable handler processes it.
execute_map_reduce
Execute a MapReduce operation with provided results.
execute_map_reduce_distributed
Execute a MapReduce operation by actually distributing work via the message router. Splits the input, sends chunks to workers, and merges results.
execute_scatter_gather
Execute the scatter-gather pattern: send a task to all capable fighters, wait for responses (with configurable timeout), and select the best result based on SelectionCriteria.
map_reduce_merge
Reduce (merge) results from multiple map workers.
map_split
Split input into chunks for map workers.
scatter_select
Select the best response from scatter-gather results.
supervisor_handle_failure
Handle a worker failure according to the supervisor strategy.
supervisor_monitor_health
Monitor worker health and handle failures via the message router. Sends heartbeat checks and restarts workers that fail to respond.