Ericsson / ered

An Erlang client library for Valkey/Redis Cluster
MIT License
11 stars 6 forks source link

Pub/sub implementation #29

Closed zuiderkwast closed 1 year ago

zuiderkwast commented 1 year ago

Special handling of commands "subscribe", "unsubscribe", "psubscribe", "punsubscribe", "ssubscribe", "sunsubscribe". These commands don't return anything apart from push messages, so they require special handling in the client implementation.

The commands mentioned above, when successful, don't return anything other than one push message per subscribed or unsubscribed channel. The pushed messages are passed to the push callback provided using the connection option push_cb. ered:command/3,4 returns {ok, undefined} for successful operation of these commands.

The representation of RESP-formatted pipeline commands is changed. This format is mainly used internally, but can also be passed to e.g. ered:command/3,4. The format is changed from {redis_command, non_neg_integer(), iodata()} to {redis_command, pipeline, [binary()]}.

Fixes #26

zuiderkwast commented 1 year ago

Questions:

... or we should at least document that we don't? ...

bjosv commented 1 year ago

Very nice. Does it affect throughput/performance in any significant way?

zuiderkwast commented 1 year ago

I haven't tested performance. We don't have any way to do that.