This commit is contained in:
2026-02-24 21:18:19 +07:00
parent 5a9e93d6e7
commit ab20cd896f

View File

@@ -493,8 +493,8 @@ async function smartsend(
**Return Value:**
- Returns a Promise that resolves to an object containing:
- `envelope` - The envelope object containing all metadata and payloads
- `envelope_json` - JSON string representation of the envelope for publishing
- `env` - The envelope object containing all metadata and payloads
- `env_json_str` - JSON string representation of the envelope for publishing
- `published` - Boolean indicating whether the message was automatically published to NATS
**Input Format:**
@@ -539,7 +539,7 @@ async function smartreceive(msg, options = {})
3. For each payload:
- Determine transport type (`direct` or `link`)
- If `direct`: Base64 decode the 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 `fileserver_download_handler`)
- Deserialize based on payload type (`dictionary`, `table`, `binary`, etc.)
4. Return envelope object with `payloads` field containing list of `(dataname, data, type)` tuples
@@ -578,9 +578,9 @@ async def smartsend(
- `fileserver_upload_handler` (Callable) - Custom upload handler function
**Return Value:**
- Returns a tuple `(envelope, envelope_json)` where:
- `envelope` - The envelope dictionary containing all metadata and payloads
- `envelope_json` - JSON string representation of the envelope for publishing
- Returns a tuple `(env, env_json_str)` where:
- `env` - The envelope dictionary containing all metadata and payloads
- `env_json_str` - JSON string representation of the envelope for publishing
**Input Format:**
- `data` - **Must be a list of (dataname, data, type) tuples**: `[(dataname1, data1, "type1"), (dataname2, data2, "type2"), ...]`