Sha256: 0f14f5de7d53371b06a673ebf61b61ca81bf23adb3edfd41ddada4dfba1931fc

Contents?: true

Size: 658 Bytes

Versions: 3

Compression:

Stored size: 658 Bytes

Contents

# frozen_string_literal: true
module LiteCable
  module Server
    module ClientSocket
      # Handle socket subscriptions
      module Subscriptions
        def subscribe(channel, broadcasting)
          LiteCable::Server.subscribers_map
                           .add_subscriber(broadcasting, self, channel)
        end

        def unsubscribe(channel, broadcasting)
          LiteCable::Server.subscribers_map
                           .remove_subscriber(broadcasting, self, channel)
        end

        def unsubscribe_from_all(channel)
          LiteCable::Server.subscribers_map.remove_socket(self, channel)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
litecable-0.4.2 lib/lite_cable/server/client_socket/subscriptions.rb
litecable-0.4.1 lib/lite_cable/server/client_socket/subscriptions.rb
litecable-0.4.0 lib/lite_cable/server/client_socket/subscriptions.rb