Method: MessageBus::HTTPClient#unsubscribe
- Defined in:
- lib/message_bus/http_client.rb
#unsubscribe(channel) {|data, global_id, message_id| ... } ⇒ Integer
unsubscribes from a channel
If a callback is given, only the specific callback will be unsubscribed.
When the client does not have any channels left, it will stop polling and waits until a new subscription is started.
202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/message_bus/http_client.rb', line 202 def unsubscribe(channel, &callback) if callback @channels[channel].callbacks.delete(callback) remove_channel(channel) if @channels[channel].callbacks.empty? else remove_channel(channel) end stop if @channels.empty? @status end |