Documentation generator: JsDoc Toolkit 2.4.0
Template: Codeview 1.2
Generated on: 2012-5-15 3:10

Class FileBuffer

The default file buffer. This is a file buffer that also has a memory buffer to which it writes when the file stream is being read out or if a write to the file failed. This class has no maximum size or any limits attached to it yet. So it is possible for this class to exhaust the memory and/or disk space of the machine using this buffer.

Class Summary
Constructor Attributes Constructor Name and Description
 
FileBuffer(path, extra)
Creates a new FileBuffer.

Method Summary

Method Attributes Method Name and Description
 
Closes the buffer and releases any external resources contained by this buffer.
 
Drain the buffer raising data events to process each message in the buffer.
 
open()
Open this file buffer if not already opened.
 
write(outMessage, [callback])
Write a message to the buffer.

Class Detail

FileBuffer(path, extra)
Creates a new FileBuffer.
Author: Ivan Porto Carrero.
Parameters:
{String} path
The path to the file to use as buffer.
{Object} extra
The extra configuration options.

Method Detail

  • close()
    Closes the buffer and releases any external resources contained by this buffer. This method is idempotent.
  • drain()
    Drain the buffer raising data events to process each message in the buffer. Truncates the buffer after draining.
  • open()
    Open this file buffer if not already opened. This method is idempotent.
  • write(outMessage, [callback])
    Write a message to the buffer.
    Parameters:
    {String|Object} outMessage
    The outbound message
    {Function} callback Optional
    The callback