fix output annotation

This commit is contained in:
2026-03-04 11:58:19 +07:00
parent 95fe697501
commit e5f4793370
8 changed files with 27 additions and 18 deletions

View File

@@ -105,11 +105,12 @@ smartsend(
broker_url="nats://localhost:4222"
)
# Receive returns a dictionary envelope with all metadata and deserialized payloads
# Receive returns a JSON object envelope with all metadata and deserialized payloads
env = smartreceive(msg; fileserver_download_handler=_fetch_with_backoff, max_retries=5, base_delay=100, max_delay=5000)
# Returns: ::JSON.Object{String, Any} - key-value structure resemble msg_envelope_v1
# env["payloads"] = [("dataname1", data1, type1), ("dataname2", data2, type2), ...]
# env["correlation_id"], env["msg_id"], etc.
# env is a dictionary containing envelope metadata and payloads field
# env is a JSON object containing envelope metadata and payloads field
```
## Architecture
@@ -147,6 +148,7 @@ The `smartsend` function now returns a tuple containing both the envelope object
```julia
env, env_json_str = smartsend(...)
# Returns: ::Tuple{msg_envelope_v1, String}
# env::msg_envelope_v1 - The envelope object with all metadata and payloads
# env_json_str::String - JSON string for publishing to NATS
```
@@ -280,8 +282,9 @@ smartsend("/test", [("single_data", mydata, "dictionary")], broker_url="nats://l
```julia
using NATSBridge
# Receive returns a dictionary with envelope metadata and payloads field
# Receive returns a JSON object with envelope metadata and payloads field
env = smartreceive(msg)
# Returns: ::JSON.Object{String, Any} - key-value structure resemble msg_envelope_v1
# env["payloads"] = [(dataname1, data1, "dictionary"), (dataname2, data2, "table"), ...]
```