Skip to main content

execute_chain_of_responsibility

Function execute_chain_of_responsibility 

Source
pub async fn execute_chain_of_responsibility(
    chain: &[ChainHandler],
    task: &str,
    router: &MessageRouter,
    coordinator: FighterId,
) -> PunchResult<Option<(FighterId, usize, String)>>
Expand description

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.