hiredis icon indicating copy to clipboard operation
hiredis copied to clipboard

Streaming API Support

Open yossigo opened this issue 5 years ago • 0 comments

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:

  1. When sending a command, register a callback that provides arguments (or chunks of arguments) which can be directly streamed to the socket.
  2. 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.

yossigo avatar Oct 03 '18 06:10 yossigo