update
This commit is contained in:
@@ -18,9 +18,9 @@ The system uses **handler functions** to abstract file server operations, allowi
|
|||||||
```julia
|
```julia
|
||||||
# Upload handler - uploads data to file server and returns URL
|
# Upload handler - uploads data to file server and returns URL
|
||||||
# The handler is passed to smartsend as fileserver_upload_handler parameter
|
# The handler is passed to smartsend as fileserver_upload_handler parameter
|
||||||
# It receives: (file_server_url::String, dataname::String, data::Vector{UInt8})
|
# It receives: (fileserver_url::String, dataname::String, data::Vector{UInt8})
|
||||||
# Returns: Dict{String, Any} with keys: "status", "uploadid", "fileid", "url"
|
# Returns: Dict{String, Any} with keys: "status", "uploadid", "fileid", "url"
|
||||||
fileserver_upload_handler(file_server_url::String, dataname::String, data::Vector{UInt8})::Dict{String, Any}
|
fileserver_upload_handler(fileserver_url::String, dataname::String, data::Vector{UInt8})::Dict{String, Any}
|
||||||
|
|
||||||
# Download handler - fetches data from file server URL with exponential backoff
|
# Download handler - fetches data from file server URL with exponential backoff
|
||||||
# The handler is passed to smartreceive as fileserver_download_handler parameter
|
# The handler is passed to smartreceive as fileserver_download_handler parameter
|
||||||
@@ -40,8 +40,8 @@ The system uses a **standardized list-of-tuples format** for all payload operati
|
|||||||
# Input format for smartsend (always a list of tuples with type info)
|
# Input format for smartsend (always a list of tuples with type info)
|
||||||
[(dataname1, data1, type1), (dataname2, data2, type2), ...]
|
[(dataname1, data1, type1), (dataname2, data2, type2), ...]
|
||||||
|
|
||||||
# Output format for smartreceive (returns a dictionary with payloads field containing list of tuples)
|
# Output format for smartreceive (returns a dictionary-like object with payloads field containing list of tuples)
|
||||||
# Returns: Dict with envelope metadata and payloads field containing Vector{Tuple{String, Any, String}}
|
# Returns: Dict-like object with envelope metadata and payloads field containing Vector{Tuple{String, Any, String}}
|
||||||
# {
|
# {
|
||||||
# "correlation_id": "...",
|
# "correlation_id": "...",
|
||||||
# "msg_id": "...",
|
# "msg_id": "...",
|
||||||
@@ -442,7 +442,7 @@ end
|
|||||||
```
|
```
|
||||||
|
|
||||||
**Output Format:**
|
**Output Format:**
|
||||||
- Returns a dictionary (key-value map) containing all envelope fields:
|
- Returns a JSON object (dictionary) containing all envelope fields:
|
||||||
- `correlation_id`, `msg_id`, `timestamp`, `send_to`, `msg_purpose`, `sender_name`, `sender_id`, `receiver_name`, `receiver_id`, `reply_to`, `reply_to_msg_id`, `broker_url`
|
- `correlation_id`, `msg_id`, `timestamp`, `send_to`, `msg_purpose`, `sender_name`, `sender_id`, `receiver_name`, `receiver_id`, `reply_to`, `reply_to_msg_id`, `broker_url`
|
||||||
- `metadata` - Message-level metadata dictionary
|
- `metadata` - Message-level metadata dictionary
|
||||||
- `payloads` - List of tuples, each containing `(dataname, data, type)` with deserialized payload data
|
- `payloads` - List of tuples, each containing `(dataname, data, type)` with deserialized payload data
|
||||||
@@ -495,7 +495,6 @@ async function smartsend(
|
|||||||
- Returns a Promise that resolves to an object containing:
|
- Returns a Promise that resolves to an object containing:
|
||||||
- `env` - The envelope object containing all metadata and payloads
|
- `env` - The envelope object containing all metadata and payloads
|
||||||
- `env_json_str` - JSON string representation of the envelope for publishing
|
- `env_json_str` - JSON string representation of the envelope for publishing
|
||||||
- `published` - Boolean indicating whether the message was automatically published to NATS
|
|
||||||
|
|
||||||
**Input Format:**
|
**Input Format:**
|
||||||
- `data` - **Must be a list of (dataname, data, type) tuples**: `[(dataname1, data1, "type1"), (dataname2, data2, "type2"), ...]`
|
- `data` - **Must be a list of (dataname, data, type) tuples**: `[(dataname1, data1, "type1"), (dataname2, data2, "type2"), ...]`
|
||||||
@@ -616,7 +615,7 @@ async def smartreceive(
|
|||||||
- `correlation_id` (str) - Optional correlation ID for tracing
|
- `correlation_id` (str) - Optional correlation ID for tracing
|
||||||
|
|
||||||
**Output Format:**
|
**Output Format:**
|
||||||
- Returns a dictionary containing all envelope fields:
|
- Returns a JSON object (dictionary) containing all envelope fields:
|
||||||
- `correlation_id`, `msg_id`, `timestamp`, `send_to`, `msg_purpose`, `sender_name`, `sender_id`, `receiver_name`, `receiver_id`, `reply_to`, `reply_to_msg_id`, `broker_url`
|
- `correlation_id`, `msg_id`, `timestamp`, `send_to`, `msg_purpose`, `sender_name`, `sender_id`, `receiver_name`, `receiver_id`, `reply_to`, `reply_to_msg_id`, `broker_url`
|
||||||
- `metadata` - Message-level metadata dictionary
|
- `metadata` - Message-level metadata dictionary
|
||||||
- `payloads` - List of tuples, each containing `(dataname, data, payload_type)` with deserialized payload data
|
- `payloads` - List of tuples, each containing `(dataname, data, payload_type)` with deserialized payload data
|
||||||
|
|||||||
Reference in New Issue
Block a user