Is there a way to disconnect from redis after using PubSub? #64
Replies: 2 comments 4 replies
-
Why we don't (currently) allow using socket for both send_object and PubSub. Library is designed around assumption that there is exactly one response for every request, For this reason we can not correctly distinguish received response from received sub message. For example, there could arrive subscription message on socket, just after request was sent and before response was received on same socket. We do not dispatch messages by type and values but only by order and we dispatch them in same order as they were sent. For similar reason it is not a option to have more than one subscriber on single connection. What I suggest is that you create new and separate About close, you can just close connection: Kind regards, Luka |
Beta Was this translation helpful? Give feedback.
-
@pangxie100 on current master we have now commit fc7c3bc that should improve on this issue. pubsub.getStream().listen((message){
print("message: $message");
},
onError : (e){
print("error: $e");
}); Let me know if that works for you and so we can roll out new release . Kind regards, Luka. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I really appreciate your work and find it easy to use. When I tried to use PubSub, I found a description said "Once PubSub is created, Command is invalidated and should not be used on the same connection." If we use PubSub, is there any way to disconnect from Redis since cmd.send_object(["QUIT"]) doesn't work any more?
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions