Method: Vines::Cluster::PubSub#unsubscribe_all

Defined in:
lib/vines/cluster/pubsub.rb

#unsubscribe_all(domain, jid) ⇒ Object

Unsubscribe the JID from all pubsub topics. This is useful when the JID’s session ends by logout or disconnect.



59
60
61
62
63
64
65
66
# File 'lib/vines/cluster/pubsub.rb', line 59

def unsubscribe_all(domain, jid)
  jid = JID.new(jid)
  redis.smembers("pubsub:#{domain}:subscriptions_#{jid}") do |nodes|
    nodes.each do |node|
      unsubscribe(domain, node, jid)
    end
  end
end