This commit is contained in:
2026-02-18 20:55:18 +07:00
parent 9c4a9ea1e5
commit 7433c147c9

View File

@@ -36,7 +36,7 @@ The system uses a **standardized list-of-tuples format** for all payload operati
[(dataname1, data1, type1), (dataname2, data2, type2), ...] [(dataname1, data1, type1), (dataname2, data2, type2), ...]
# Output format for smartreceive (always returns a list of tuples) # Output format for smartreceive (always returns a list of tuples)
[(dataname1, data1), (dataname2, data2), ...] [(dataname1, data1, type1), (dataname2, data2, type2), ...]
``` ```
**Supported Types:** **Supported Types:**
@@ -83,7 +83,7 @@ smartsend(
# Receive always returns a list # Receive always returns a list
payloads = smartreceive(msg, fileserverDownloadHandler, max_retries, base_delay, max_delay) payloads = smartreceive(msg, fileserverDownloadHandler, max_retries, base_delay, max_delay)
# payloads = [("dataname1", data1), ("dataname2", data2), ...] # payloads = [("dataname1", data1, type1), ("dataname2", data2, type2), ...]
``` ```
## Architecture Diagram ## Architecture Diagram
@@ -338,13 +338,13 @@ function smartreceive(
# If direct: decode Base64 payload # If direct: decode Base64 payload
# If link: fetch from URL with exponential backoff using fileserverDownloadHandler # If link: fetch from URL with exponential backoff using fileserverDownloadHandler
# Deserialize payload based on type # Deserialize payload based on type
# Return list of (dataname, data) tuples # Return list of (dataname, data, type) tuples
end end
``` ```
**Output Format:** **Output Format:**
- Always returns a list of tuples: `[(dataname1, data1), (dataname2, data2), ...]` - Always returns a list of tuples: `[(dataname1, data1, type1), (dataname2, data2, type2), ...]`
- Even for single payloads: `[(dataname1, data1)]` - Even for single payloads: `[(dataname1, data1, type1)]`
**Process Flow:** **Process Flow:**
1. Parse the JSON envelope to extract the `payloads` array 1. Parse the JSON envelope to extract the `payloads` array
@@ -354,7 +354,7 @@ end
- If `direct`: decode Base64 data from the message - If `direct`: decode Base64 data from the message
- If `link`: fetch data from URL using exponential backoff (via `fileserverDownloadHandler`) - If `link`: fetch data from URL using exponential backoff (via `fileserverDownloadHandler`)
- Deserialize based on payload type (`dictionary`, `table`, `binary`, etc.) - Deserialize based on payload type (`dictionary`, `table`, `binary`, etc.)
4. Return list of `(dataname, data)` tuples 4. Return list of `(dataname, data, type)` tuples
**Note:** The `fileserverDownloadHandler` receives `(url::String, max_retries::Int, base_delay::Int, max_delay::Int, correlation_id::String)` and returns `Vector{UInt8}`. **Note:** The `fileserverDownloadHandler` receives `(url::String, max_retries::Int, base_delay::Int, max_delay::Int, correlation_id::String)` and returns `Vector{UInt8}`.
@@ -409,7 +409,7 @@ async function smartreceive(msg, options = {})
- If `direct`: decode Base64 data from the message - If `direct`: decode Base64 data from the message
- If `link`: fetch data from URL using exponential backoff - If `link`: fetch data from URL using exponential backoff
- Deserialize based on payload type (`dictionary`, `table`, `binary`, etc.) - Deserialize based on payload type (`dictionary`, `table`, `binary`, etc.)
4. Return list of `(dataname, data)` tuples 4. Return list of `(dataname, data, type)` tuples
## Scenario Implementations ## Scenario Implementations