Replies: 1 comment 1 reply
-
|
I'm a big fan of this design, especially considering that we could introduce both, synchronous clients and no_std (hopefully, at some point in the future). Speaking of the mentioned client changes, do you have something specific in mind already (e.g., changing the existing traits), or is it mostly about resolving the initial client transport/protocol? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
We propose decoupling network I/O from protocol logic in the Iggy SDK by introducing a Sans-IO layer (initially a TCP client) and a runtime abstraction (spawn/sleep/timers). This will:
Motivation
The current implementation is tightly coupled to a specific async runtime (Tokio) and network stack, which:
Guide-level explanation
Basic usage with the TCP client (as in benchmarks):
In the draft implementation the runtime is passed explicitly; in the final version the choice is planned at compile time (via cfg/features).
Reference-level explanation
Goal: a minimal contract compatible with multiple runtimes, to be reused not only in the client but also in producer/consumer/etc. (spawn nuances may be refined — see Unresolved questions).
2. Transport (for now, TCP)
A single background executor ConnectionDriver (one Future) that:
Drawbacks
Rationale and alternatives
Prior art
Unresolved questions
Future possibilities
Adding TcpTokio in the draft leads to a combinatorial explosion as we expand (e.g., TcpTlsTokio, Quinn, TcpSmol, etc.). @marvin-hansen suggested:
This is better, but method duplication remains. For example:
To avoid “generic pollution” while not bloating the enum, we can export a concrete type at compile time via a type alias under a feature-flag:
Under different features we can export different aliases (Tokio TCP, QUIC, etc.), preventing generics from leaking into the public API and eliminating duplicated methods in a large enum
Beta Was this translation helpful? Give feedback.
All reactions