Bienvenue sur FlowZap, l'application pour créer des diagrammes avec Rapidité, Clarté et Contrôle.

Flux de travail de fan-out fan-in

patterns

Modèle fan-out/fan-in avec distribution de travail vers des travailleurs parallèles, exécution concurrente, agrégation des résultats et gestion d'erreurs pour les échecs partiels.

Code FlowZap complet

Orchestrator { # Orchestrator
n1: circle label:"Start"
n2: rectangle label:"Receive batch request"
n3: rectangle label:"Split into work items"
n4: rectangle label:"Aggregate results"
n5: rectangle label:"Return combined response"
n6: circle label:"End"
n1.handle(right) -> n2.handle(left)
n2.handle(right) -> n3.handle(left)
n3.handle(bottom) -> Worker1.n7.handle(top) [label="Item 1"]
n3.handle(bottom) -> Worker2.n11.handle(top) [label="Item 2"]
n3.handle(bottom) -> Worker3.n15.handle(top) [label="Item 3"]
n4.handle(right) -> n5.handle(left)
n5.handle(right) -> n6.handle(left)
}
Worker1 { # Worker 1
n7: rectangle label:"Process work item"
n8: diamond label:"Processing successful?"
n9: rectangle label:"Return result"
n10: rectangle label:"Return error"
n7.handle(right) -> n8.handle(left)
n8.handle(right) -> n9.handle(left) [label="Yes"]
n8.handle(bottom) -> n10.handle(top) [label="No"]
n9.handle(top) -> Aggregator.n19.handle(bottom) [label="Result 1"]
n10.handle(top) -> Aggregator.n19.handle(bottom) [label="Error 1"]
}
Worker2 { # Worker 2
n11: rectangle label:"Process work item"
n12: diamond label:"Processing successful?"
n13: rectangle label:"Return result"
n14: rectangle label:"Return error"
n11.handle(right) -> n12.handle(left)
n12.handle(right) -> n13.handle(left) [label="Yes"]
n12.handle(bottom) -> n14.handle(top) [label="No"]
n13.handle(top) -> Aggregator.n19.handle(bottom) [label="Result 2"]
n14.handle(top) -> Aggregator.n19.handle(bottom) [label="Error 2"]
}
Worker3 { # Worker 3
n15: rectangle label:"Process work item"
n16: diamond label:"Processing successful?"
n17: rectangle label:"Return result"
n18: rectangle label:"Return error"
n15.handle(right) -> n16.handle(left)
n16.handle(right) -> n17.handle(left) [label="Yes"]
n16.handle(bottom) -> n18.handle(top) [label="No"]
n17.handle(top) -> Aggregator.n19.handle(bottom) [label="Result 3"]
n18.handle(top) -> Aggregator.n19.handle(bottom) [label="Error 3"]
}
Aggregator { # Aggregator
n19: rectangle label:"Wait for all workers"
n20: rectangle label:"Combine results"
n21: diamond label:"All succeeded?"
n22: rectangle label:"Return success"
n23: rectangle label:"Return partial failure"
n19.handle(right) -> n20.handle(left)
n20.handle(right) -> n21.handle(left)
n21.handle(right) -> n22.handle(left) [label="Yes"]
n21.handle(bottom) -> n23.handle(top) [label="No"]
n22.handle(top) -> Orchestrator.n4.handle(bottom) [label="Complete"]
n23.handle(top) -> Orchestrator.n4.handle(bottom) [label="Partial"]
}

Modèles associés

Processus de traitement par lots

patterns

Schéma de traitement par lots avec planification des jobs, traitement par segments (chunks), capacité de reprise sur point de contrôle, gestion des erreurs et rapport de fin de traitement.

Retour à tous les modèles