You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had some code where I needed to subscribe to a channel before I entered the blocking subscription loop. This does not work because you get "Already in subscription loop" as an error message, since {_subscription_loop} is assigned -1 in &subscribe. I don't know if that's a feature or a bug, it was certainly a surprise.
No matter, I attempted this and got this error:
use strict; use warnings;
use RedisDB::Parser v2.20;
use RedisDB v2.29;
my$r = RedisDB->new;
$r->subscribe("foo");
$r->get_reply;
# uncomment for this to work# $r->{_psubscribed} = {};$r->unsubscribe("foo"); # this will cause a crash$r->unsubscribe; # this too will cause a crash
Can't use an undefined value as a HASH reference at /tmp/RedisDB-2.29/blib/lib/RedisDB.pm line 1348.
The text was updated successfully, but these errors were encountered:
Thanks for the report. The first issue is intended behaviour, I will look if it is possible to fix. The second is definitely a bug, I have no time right now, but will release the fix tomorrow.
it should be possible to subscribe to some channels first,
and then enter subscription loop. I still need to fix callback
handling before entering subscription loop, currently get_reply
will return message instead of invoking callback. See #18
I had some code where I needed to subscribe to a channel before I entered the blocking subscription loop. This does not work because you get "Already in subscription loop" as an error message, since {_subscription_loop} is assigned -1 in &subscribe. I don't know if that's a feature or a bug, it was certainly a surprise.
No matter, I attempted this and got this error:
The text was updated successfully, but these errors were encountered: