Completely generic request/response client built on tower::Service,
futures::Stream and futures::Sink.
- Create a [
Service] and [Task].- Connect them to each other over a [
Stream]/[Sink], allowing you to configure your own e.g queue depth, MPSC etc. - Give the [
Task] a [Stream]/[Sink] transport to own. This is typically a wrapper over e.g a websocket connection.
- Connect them to each other over a [
- You
callthe [Service] with a [Dialogue]. - The [
Service] formats this into an [Ask] for the [Task]. - The [
Task] assigns the request an identifier for correlation using an [IdFactory], and sends the pair to the transport. - A response eventually arrives on the transport.
- The [
Task] reacts to the response, resolving theFuturereturned in(1).
[Task]s also handle timeouts, and propogating errors from the transport.