Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

41 lines (29 sloc) 0.723 kb

Usage

  • At any time at most one Appender and at most one Reader may be running for a specific dir.

Appending

require 'eventbuf'

appender = EventBuf::Appender.new "...some dir...", :mkdirp => true

# about 0.5 seconds
(1...1000).each do |i|
  appender.log "Foo"
end

# much faster
(1...1000).each do |i|
  appender.log "Foo", :fsync => false
end

Reading

require 'eventbuf'

reader = EventBuf::Reader.new "...some dir..."
while true
  event = reader.peek()# blocks until there is one
  puts event[:ms]
  if upload_to_server event[:data]
    reader.advance()# NOT YET IMPLEMENTED
  end
end

File Format

See node-eventbuf's README

Jump to Line
Something went wrong with that request. Please try again.