hiredis
hiredis copied to clipboard
Streaming API Support
Currently commands and replies are stored entirely in memory, which is very inefficient for large commands/replies that would anyway be streamed to some file/other socket/etc.
Ideally a streaming API should make it possible to:
- When sending a command, register a callback that provides arguments (or chunks of arguments) which can be directly streamed to the socket.
- When receiving a reply, register a callback that gets called to consume arguments or argument chunks as they are received.
Another possibility is to implement streaming support at a lower level, e.g. make the buffer implementation pluggable by the user. I believe this will make the API less friendly but may be more practical to implement.