update
This commit is contained in:
@@ -387,9 +387,20 @@ function smartsend(
|
||||
nats_url::String = "nats://localhost:4222",
|
||||
fileserverUploadHandler::Function = plik_oneshot_upload,
|
||||
size_threshold::Int = 1_000_000 # 1MB
|
||||
is_publish::Bool = true # Whether to automatically publish to NATS
|
||||
)
|
||||
```
|
||||
|
||||
**Return Value:**
|
||||
- Returns a tuple `(env, msg_json_str)` where:
|
||||
- `env::msgEnvelope_v1` - The envelope object containing all metadata and payloads
|
||||
- `msg_json_str::String` - JSON string representation of the envelope for publishing
|
||||
|
||||
**Options:**
|
||||
- `is_publish::Bool = true` - When `true` (default), the message is automatically published to NATS. When `false`, the function returns the envelope and JSON string without publishing, allowing manual publishing via NATS request-reply pattern.
|
||||
|
||||
The envelope object can be accessed directly for programmatic use, while the JSON string can be published directly to NATS using the request-reply pattern.
|
||||
|
||||
**Input Format:**
|
||||
- `data::AbstractArray{Tuple{String, Any, String}}` - **Must be a list of (dataname, data, type) tuples**: `[("dataname1", data1, "type1"), ("dataname2", data2, "type2"), ...]`
|
||||
- Even for single payloads: `[(dataname1, data1, "type1")]`
|
||||
|
||||
Reference in New Issue
Block a user