Class: CircleCI::CLI::Networking::CircleCIPusherClient
- Inherits:
-
Object
- Object
- CircleCI::CLI::Networking::CircleCIPusherClient
- Defined in:
- lib/circleci/cli/networking/pusher_client.rb
Instance Method Summary collapse
- #bind(channel, event) ⇒ Object
- #bind_event_json(channel, event) ⇒ Object
- #connect ⇒ Object
- #unsubscribe(channel) ⇒ Object
Instance Method Details
#bind(channel, event) ⇒ Object
14 15 16 17 |
# File 'lib/circleci/cli/networking/pusher_client.rb', line 14 def bind(channel, event, &) socket.subscribe(channel) socket[channel].bind(event, &) end |
#bind_event_json(channel, event) ⇒ Object
19 20 21 |
# File 'lib/circleci/cli/networking/pusher_client.rb', line 19 def bind_event_json(channel, event, &) bind(channel, event) { |data| JSON.parse(data).each(&) } end |
#connect ⇒ Object
9 10 11 12 |
# File 'lib/circleci/cli/networking/pusher_client.rb', line 9 def connect PusherClient.logger.level = Logger::ERROR socket.connect(true) end |
#unsubscribe(channel) ⇒ Object
23 24 25 |
# File 'lib/circleci/cli/networking/pusher_client.rb', line 23 def unsubscribe(channel) socket.unsubscribe(channel) end |