Class OpenWFE::Journal::Bucket
In: lib/openwfe/expool/journal.rb
Parent: Object

for each process instance, there is one bucket holding the events waiting to get written in the journal

Methods

<<   flush   length   new   size  

Attributes

events  [R] 
path  [R] 

Public Class methods

[Source]

     # File lib/openwfe/expool/journal.rb, line 196
196:                 def initialize (path)
197:                     super()
198:                     @path = path
199:                     @events = []
200:                 end

Public Instance methods

[Source]

     # File lib/openwfe/expool/journal.rb, line 202
202:                 def << (event)
203:                     @events << event
204:                 end

[Source]

     # File lib/openwfe/expool/journal.rb, line 211
211:                 def flush
212:                     File.open(@path, "a+") do |f|
213:                         @events.each do |e|
214:                             f.puts e
215:                         end
216:                     end
217:                     @events.clear
218:                 end
length()

Alias for size

[Source]

     # File lib/openwfe/expool/journal.rb, line 206
206:                 def size
207:                     @events.size
208:                 end

[Validate]