class Fluent::Tranquility::Pusher

Attributes

connection[RW]
dataset[R]

Public Class Methods

new(connection, dataset) click to toggle source
# File lib/fluent/tranquility/pusher.rb, line 6
def initialize(connection, dataset)
  @connection = connection
  @dataset    = dataset
end

Public Instance Methods

call(data) click to toggle source
# File lib/fluent/tranquility/pusher.rb, line 11
def call(data)
  res = connection.post("/v1/post/#{dataset}") do |req|
    req.headers['Content-Type'] = 'text/plain'
    req.body = data
    req.params['async'] = true
    req.options.timeout = 60
    req.options.open_timeout = 60
  end

  res.success?
end