Domen Lušina Domen Lušina - 2 years ago 148
Ruby Question

Redis `CLIENT KILL TYPE pubsub` command equivalent in ruby

I would like to know if there is a ruby equivalent to Redis

command or a hack how to do it.

Thank you for help

Answer Source

If you are talking about rewriting the Redis command to ruby using the redis gem, you can call any command using the call method available on the initiated Redis client. All arguments must be passed in an array together with the command name, such as this:

# first just an example that calling commands like this works:["client", "list"])
# => "addr= fd=5 name= age=338 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=client\n

# the kill command follows:["client", "kill", "type", "pubsub"])
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download