Parent

Class/Module Index [+]

Quicksearch

Fluent::StreamOutput

obsolete

Public Class Methods

new() click to toggle source
# File lib/fluent/plugin/out_stream.rb, line 23
def initialize
  require 'socket'
  require 'fileutils'
  super
end

Public Instance Methods

configure(conf) click to toggle source
# File lib/fluent/plugin/out_stream.rb, line 31
def configure(conf)
  super
end
flush_secondary(secondary) click to toggle source
# File lib/fluent/plugin/out_stream.rb, line 55
def flush_secondary(secondary)
  unless secondary.is_a?(StreamOutput)
    secondary = ReformatWriter.new(secondary)
  end
  @buffer.pop(secondary)
end
format_stream(tag, es) click to toggle source
# File lib/fluent/plugin/out_stream.rb, line 35
def format_stream(tag, es)
  # use PackedForward
  [tag, es.to_msgpack_stream].to_msgpack
end
write(chunk) click to toggle source
# File lib/fluent/plugin/out_stream.rb, line 40
def write(chunk)
  sock = connect
  begin
    opt = [1, @send_timeout.to_i].pack('I!I!')  # { int l_onoff; int l_linger; }
    sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_LINGER, opt)

    opt = [@send_timeout.to_i, 0].pack('L!L!')  # struct timeval
    sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_SNDTIMEO, opt)

    chunk.write_to(sock)
  ensure
    sock.close
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.