lib/fourtrack/recorder.rb in fourtrack-0.1.0 vs lib/fourtrack/recorder.rb in fourtrack-0.2.0
- old
+ new
@@ -3,16 +3,16 @@
# Is thread safe and uses gzip compression. Writes are performed using a binary UNIX
# append, which with a small-ish record size should guarantee atomic append.
class Fourtrack::Recorder
require 'logger'
NULL_LOGGER = Logger.new(nil)
- def initialize(output_path:, flush_after_n:, logger: NULL_LOGGER)
+ def initialize(output_path:, flush_after:, logger: NULL_LOGGER)
@output_path = File.expand_path(output_path)
@pid_at_create = Process.pid
@logger = logger
@buf = []
@mux = Mutex.new
- @flush_every = flush_after_n
+ @flush_every = flush_after
# Attempt to open the file for writing,
# which will raise an exception outright if we do not have access
File.open(@output_path, 'a') {}
# and once we know we were able to open it, install an at_exit block for ourselves
install_at_exit_hook!