class Staccato::Proxy::Supervisor

Attributes

options[R]

Public Class Methods

new(options) click to toggle source
# File lib/staccato/proxy/supervisor.rb, line 5
def initialize(options)
  @options = options
end

Public Instance Methods

debug?() click to toggle source
# File lib/staccato/proxy/supervisor.rb, line 21
def debug?
  options.fetch(:debug, false)
end
host() click to toggle source
# File lib/staccato/proxy/supervisor.rb, line 9
def host
  options.fetch(:host, '0.0.0.0')
end
port() click to toggle source
# File lib/staccato/proxy/supervisor.rb, line 13
def port
  options.fetch(:port, 9090)
end
run() click to toggle source
# File lib/staccato/proxy/supervisor.rb, line 25
def run
  config.deploy
  self
end
terminate() click to toggle source
# File lib/staccato/proxy/supervisor.rb, line 30
def terminate
  config.shutdown
end
url() click to toggle source
# File lib/staccato/proxy/supervisor.rb, line 17
def url
  options.fetch(:url, GA_COLLECTION_URL)
end

Private Instance Methods

config() click to toggle source
# File lib/staccato/proxy/supervisor.rb, line 35
def config
  @config ||= Celluloid::Supervision::Configuration.define([
    {
      type: Staccato::Proxy::Listener, as: :staccato_proxy_listener, args: [host, port, debug?]
    },
    {
      type: Staccato::Proxy::Sender, as: :staccato_proxy_sender, args: [url, debug?]
    }
  ])
end