Maybe there is a way to do it via redix? Either way, redix probably keeps the socket in it’s state, you can try a hack like :sys.get_state(redix_conn) to find out.
:gen_tcp.recv(socket, 0) might not work if the socket is started in active: true mode. Seems like it is started with active: :once. And is reset to that mode after each received packet. So you might try something like
But a more correct approach is most likely possible, since you might receive the data you don’t need, which would in turn make other queued requests fail.
I’d probably fork redix and add a way to subscribe for updates, especially if it’s some special redis server.