Confluence
Unified Fan-in and Fan-out Event Processing
Core Idea
API Surface
Fan-out: One Event, Multiple Nodes
// Register a handler across multiple nodes using an array
[orderNode, paymentNode, inventoryNode].on("update", (event, context) => {
// Handler receives events from any of these nodes
console.log(`Processing update in ${context.node.id}`);
});
// Send an event to multiple nodes using an array
[orderNode, shippingNode, notificationNode].send({
type: "order-completed",
payload: { orderId: "ORD-123" }
});Fan-in: Multiple Events, One Handler
The Event Continuum and Divergent Flows
No Config Needed
Causality Preservation
Context in Multi-Node Operations
Node-Specific Context Structure
Results Collection
Batch Context Structure
Combined Multi-Node and Batch Operations
Examples
Explicit Batch Creation and Processing
Distributed Notification System with Divergent Flows
Manual Batch Processing
Performance Considerations
When to Use Batching
When to Use Multi-node Operations
Batch Processing Efficiency
Memory Management
Conclusion
Last updated