This commit is contained in:
2026-03-05 07:23:24 +07:00
parent a98394b9b9
commit 206467e1fa
3 changed files with 93 additions and 46 deletions

View File

@@ -117,29 +117,42 @@ env = smartreceive(msg; fileserver_download_handler=_fetch_with_backoff, max_ret
The Julia implementation follows the Claim-Check pattern:
```
┌─────────────────────────────────────────────────────────────────────────┐
SmartSend Function │
└─────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────┐
│ Is payload size < 1MB? │
└─────────────────────────────────────────────────────────────────────────┘
┌─────────────────┴─────────────────┐
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Direct Path │ │ Link Path │
│ (< 1MB) │ │ (> 1MB) │
│ │ │ │
│ • Serialize to │ │ • Serialize to │
│ Buffer │ │ Buffer │
│ • Base64 encode │ │ • Upload to │
│ • Publish to │ │ HTTP Server │
│ NATS │ │ • Publish to │
│ │ │ NATS with URL │
└─────────────────┘ └─────────────────┘
```mermaid
flowchart TB
subgraph Sender["Julia Application (Sender)"]
App[App Code]
NATSBridge[NATSBridge]
NATS_Client[<b>NATS.jl</b>]
end
subgraph Receiver["Julia Application (Receiver)"]
App_Recv[App Code]
NATSBridge_Recv[NATSBridge]
NATS_Client_Recv[<b>NATS.jl</b>]
end
subgraph Infrastructure["Infrastructure"]
NATS[<b>NATS Server</b><br/>Message Broker]
FileServer[<b>HTTP File Server</b><br/>Upload/Download]
end
App --> NATSBridge
NATSBridge --> NATS_Client
NATS_Client --> NATS
NATS --> NATS_Client_Recv
NATS_Client_Recv --> NATSBridge_Recv
NATSBridge_Recv --> App_Recv
NATSBridge -.->|HTTP POST upload| FileServer
FileServer -.->|HTTP GET download| NATSBridge_Recv
style App fill:#e8f5e9
style App_Recv fill:#e8f5e9
style NATSBridge fill:#c5e1a5
style NATSBridge_Recv fill:#c5e1a5
style NATS fill:#fff3e0
style FileServer fill:#f3e5f5
```
## smartsend Return Value