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
require "redis"
redis = Redis::PooledClient.new
sub_connection = redis.pool.checkout
sub_connection.subscribe("foo") do |on|
on.message do |c, m|
p({c, m})
sub_connection.unsubscribe(c)
end
end
# We're done with pub/sub using sub_connection at this point, return it to the pool:
redis.pool.checkin(sub_connection)
# The following fails because the only connection in the pool was previously
# used for pub/sub, and is still internally configured as such:
# Unhandled exception: Command SET not allowed in the context of a subscribed connection (Redis::Error)
redis.set("foo", "bar")
The text was updated successfully, but these errors were encountered:
As mentioned here: #83
The text was updated successfully, but these errors were encountered: