MySQL::Slurp::Writer - Adds buffering / locking writing to MySQL::Slurp


MySQL-Slurp documentation  | view source Contained in the MySQL-Slurp distribution.

Index


NAME

Top

MySQL::Slurp::Writer - Adds buffering / locking writing to MySQL::Slurp

SYNOPSIS

Top

    my $writer = MySQL::Slurp::Writer->new( ... );

    $writer->print( "records\tto\tprint\n" );




DESCRIPTION

Top

This module wraps IO::File to provide a thread-safe method for writing to a file handles. The method is simple ... writing is buffered; the file handle is locked; the output is written to the file handle, the lock is released.

METHODS

Top

new

Create a new MySQL::Slurp::Writer object

buffer

The size of the buffer. The default is 1 record, i.e. no buffering.

filename

The filename of the IO::File object

print

flush

Flush the buffer

close

Closes the writing file handle

lock_ex

Block until an exclusive lock can be made on the file handle

lock_un

Release the lock

TODO

Top

- item Generalize to object independent of MySQL::Slurp

SEE ALSO

Top

MySQL::Slurp, IO::File, Moose

AUTHOR

Top

Christopher Brown, <ctbrown@cpan.org<gt>

http://www.opendatagroup.com

COPYRIGHT AND LICENSE

Top


MySQL-Slurp documentation  | view source Contained in the MySQL-Slurp distribution.