Class: BitGirder::Event::File::EventFileWriter

Inherits:
EventFileIo
  • Object
show all
Defined in:
lib/bitgirder/event/file.rb

Constant Summary collapse

DEFAULT_ROTATE_SIZE =
Io::DataSize.as_instance( "64m" )

Constants inherited from EventFileIo

BitGirder::Event::File::EventFileIo::DEFAULT_BUFFER_SIZE, BitGirder::Event::File::EventFileIo::HEADER_SIZE

Instance Method Summary collapse

Instance Method Details

#closeObject



219
220
221
222
223
# File 'lib/bitgirder/event/file.rb', line 219

def close

    @closed = true
    impl_flush if @io
end

#closed?Boolean

Returns:

  • (Boolean)


65
66
67
# File 'lib/bitgirder/event/file.rb', line 65

def closed?
    @closed
end

#write_event(ev) ⇒ Object

Raises:



206
207
208
209
210
211
212
213
214
215
216
# File 'lib/bitgirder/event/file.rb', line 206

def write_event( ev )
    
    raise ClosedError if @closed

    str_io = new_string_io
    @codec.encode_event( ev, str_io )

    io_sz = str_io.pos + HEADER_SIZE

    impl_write_event( str_io, io_sz )
end