Class: Logglier::Client::HTTP

Inherits:
Object
  • Object
show all
Includes:
InstanceMethods
Defined in:
lib/logglier/client/http.rb,
lib/logglier/client/http/sync.rb,
lib/logglier/client/http/threaded.rb

Defined Under Namespace

Classes: DeliveryThread, DeliveryThreadManager, NetHTTPProxy

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from InstanceMethods

#formatter, #masher, #masherize_key, #massage_message, #setup_input_uri

Constructor Details

#initialize(opts = {}) ⇒ HTTP

Returns a new instance of HTTP.



13
14
15
16
17
18
19
20
21
# File 'lib/logglier/client/http.rb', line 13

def initialize(opts={})
  setup_input_uri(opts)
  @format = opts[:format] ? opts[:format].to_sym : nil
  @deliverer = if opts[:threaded]
    Logglier::Client::HTTP::DeliveryThreadManager.new(@input_uri, opts)
  else
    Logglier::Client::HTTP::NetHTTPProxy.new(@input_uri, opts)
  end
end

Instance Attribute Details

#delivererObject (readonly)

Returns the value of attribute deliverer.



11
12
13
# File 'lib/logglier/client/http.rb', line 11

def deliverer
  @deliverer
end

#input_uriObject (readonly)

Returns the value of attribute input_uri.



11
12
13
# File 'lib/logglier/client/http.rb', line 11

def input_uri
  @input_uri
end

Instance Method Details

#closeObject



27
28
29
# File 'lib/logglier/client/http.rb', line 27

def close
  nil
end

#write(message) ⇒ Object



23
24
25
# File 'lib/logglier/client/http.rb', line 23

def write(message)
  @deliverer.deliver(message)
end