1 unstable release
| 0.1.0 | Apr 17, 2025 |
|---|
#13 in #stream-sink
51KB
1K
SLoC
Completely generic request/response client built on tower::Service,
futures::Stream and futures::Sink.
sequenceDiagram
participant app as Your Application
participant svc as ez_client::Service
participant task as ez_client::Task
participant transport as TransportT
autonumber
app->>svc: RequestT
svc->>task: ez_client::Ask
note over svc,task: message over a Sink/Stream
task->>transport: (RequestT, IdT)
note over task,transport: message over a Sink/Stream
note over task: wait for response...
transport->>task: (ResponseT, IdT)
task->>app: ResponseT
<script type="module">
import mermaid from "https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs";
var doc_theme = localStorage.getItem("rustdoc-theme");
if (doc_theme === "dark" || doc_theme === "ayu") mermaid.initialize({theme: "dark"});
</script>
- Create a
ServiceandTask. - You
calltheServicewith aDialogue. - The
Serviceformats this into an [Ask] for theTask. - The
Taskassigns the request an identifier for correlation using anIdFactory, and sends the pair to the transport. - A response eventually arrives on the transport.
- The
Taskreacts to the response, resolving theFuturereturned in(1).
Tasks also handle timeouts, and propogating errors from the transport.
Dependencies
~1.8–2.5MB
~43K SLoC