Class: StatsCloud::RegisterConnectionJob

Inherits:
Object
  • Object
show all
Includes:
LoggerHelper
Defined in:
lib/statscloud/jobs/register_connection_job.rb

Overview

Registers StatsCloud connection.

Constant Summary collapse

ERROR_CODES =
[400, 401, 404, 500].freeze

Instance Method Summary collapse

Methods included from LoggerHelper

#log_error, #log_info, #logger

Constructor Details

#initialize(cluster_client, token, app, tags) ⇒ RegisterConnectionJob

Returns a new instance of RegisterConnectionJob.



14
15
16
17
18
19
20
# File 'lib/statscloud/jobs/register_connection_job.rb', line 14

def initialize(cluster_client, token, app, tags)
  @cluster_client = cluster_client
  @token = token
  @app = app
  @tags = tags
  @job_running = false
end

Instance Method Details

#startObject



22
23
24
25
26
27
28
# File 'lib/statscloud/jobs/register_connection_job.rb', line 22

def start
  Thread.new do
    event_machine.run do
      event_machine.add_periodic_timer(3600) { run_job }
    end
  end.join
end