From 4a8ad825a5087e595aa8a3acddc2aff667912059 Mon Sep 17 00:00:00 2001 From: Zachary Huang <33015448+zachary62@users.noreply.github.com> Date: Sat, 15 Mar 2025 02:00:27 -0400 Subject: [PATCH] Update communication.md --- docs/core_abstraction/communication.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/core_abstraction/communication.md b/docs/core_abstraction/communication.md index 85c0276..6288c9c 100644 --- a/docs/core_abstraction/communication.md +++ b/docs/core_abstraction/communication.md @@ -7,9 +7,9 @@ nav_order: 3 # Communication -Nodes and Flows **communicate** in two ways: +Nodes and Flows **communicate** in 2 ways: -1. **Shared Store (recommended)** +1. **Shared Store (for almost all the cases)** - A global data structure (often an in-mem dict) that all nodes can read and write by `prep()` and `post()`. - Great for data results, large content, or anything multiple nodes need. @@ -21,7 +21,7 @@ Nodes and Flows **communicate** in two ways: If you know memory management, think of the **Shared Store** like a **heap** (shared by all function calls), and **Params** like a **stack** (assigned by the caller). -> Use `Shared Store` for almost all cases. It's flexible and easy to manage. It separates *Data Schema* from *Compute Logic*, making the code easier to maintain. `Params` is more a syntax sugar for [Batch](./batch.md). +> **Separation of Concerns:** Use `Shared Store` for almost all cases to separate *Data Schema* from *Compute Logic*! This approach is both flexible and easy to manage, resulting in more maintainable code. `Params` is more a syntax sugar for [Batch](./batch.md). {: .best-practice } --- @@ -123,4 +123,4 @@ flow = Flow(start=node) # 5) Set Flow params (overwrites node params) flow.set_params({"filename": "doc2.txt"}) flow.run(shared) # The node summarizes doc2, not doc1 -``` \ No newline at end of file +```