class OkComputer::PusherCheck

Constants

ChannelError

Attributes

client[RW]

Public Class Methods

new(client: nil, app_id: nil, app_key: nil, app_secret: nil, app_cluster: nil) click to toggle source
# File lib/ok_computer/checks/pusher_check.rb, line 11
def initialize(client: nil, app_id: nil, app_key: nil, app_secret: nil, app_cluster: nil)
  client ||= Pusher::Client.new(
    app_id: app_id,
    key: app_key,
    secret: app_secret,
    cluster: app_cluster,
    use_tls: true
  )

  self.client = client
end

Public Instance Methods

check() click to toggle source

Public: Return the status of the Channels check

# File lib/ok_computer/checks/pusher_check.rb, line 24
def check
  perform_request
  mark_message('Channels check successful')
rescue StandardError => e
  mark_message("Error: '#{e}'")
  mark_failure
end
perform_request() click to toggle source
# File lib/ok_computer/checks/pusher_check.rb, line 32
def perform_request
  client.get('/channels')
rescue StandardError => e
  raise(ChannelError, e)
end