add_mix_content_capability #2
@@ -53,7 +53,7 @@ struct msgPayload_v1
|
|||||||
encoding::String # "none | json | base64 | arrow-ipc"
|
encoding::String # "none | json | base64 | arrow-ipc"
|
||||||
size::Integer # data size in bytes e.g. 15433
|
size::Integer # data size in bytes e.g. 15433
|
||||||
data::Any # payload data in case of direct transport or a URL in case of link
|
data::Any # payload data in case of direct transport or a URL in case of link
|
||||||
metadata::Dict{String, Any} # Dict("checksum=> "sha256_hash", ...) This metadata is for this payload
|
metadata::Dict{String, Any} # Dict("checksum" => "sha256_hash", ...) This metadata is for this payload
|
||||||
end
|
end
|
||||||
|
|
||||||
# constructor
|
# constructor
|
||||||
@@ -530,7 +530,7 @@ end
|
|||||||
This function processes incoming NATS messages, handling both direct transport
|
This function processes incoming NATS messages, handling both direct transport
|
||||||
(base64 decoded payloads) and link transport (URL-based payloads).
|
(base64 decoded payloads) and link transport (URL-based payloads).
|
||||||
It deserializes the data based on the transport type and returns the result.
|
It deserializes the data based on the transport type and returns the result.
|
||||||
A HTTP file server is required along with its upload function.
|
A HTTP file server is required along with its download function.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
- `msg::NATS.Msg` - NATS message to process
|
- `msg::NATS.Msg` - NATS message to process
|
||||||
@@ -542,14 +542,14 @@ Keyword Arguments:
|
|||||||
- `max_delay::Int` - Maximum delay for exponential backoff in ms (default: 5000)
|
- `max_delay::Int` - Maximum delay for exponential backoff in ms (default: 5000)
|
||||||
|
|
||||||
Return:
|
Return:
|
||||||
- `AbstractArray{Tuple{String, Any}}` - List of (dataname, data) tuples
|
- `AbstractArray{Tuple{String, Any, String}}` - List of (dataname, data, type) tuples
|
||||||
|
|
||||||
# Example
|
# Example
|
||||||
```julia
|
```julia
|
||||||
# Receive and process message
|
# Receive and process message
|
||||||
msg = nats_message # NATS message
|
msg = nats_message # NATS message
|
||||||
payloads = smartreceive(msg, fileserverDownloadHandler, max_retries, base_delay, max_delay)
|
payloads = smartreceive(msg; fileserverDownloadHandler=_fetch_with_backoff, max_retries=5, base_delay=100, max_delay=5000)
|
||||||
# payloads = [("dataname1", data1), ("dataname2", data2), ...]
|
# payloads = [("dataname1", data1, "type1"), ("dataname2", data2, "type2"), ...]
|
||||||
```
|
```
|
||||||
"""
|
"""
|
||||||
function smartreceive(
|
function smartreceive(
|
||||||
|
|||||||
Reference in New Issue
Block a user