|
NAMEJLog::Reader - Perl extension for reading to a jlog journal.SUMMARYuse JLog::Reader; # create a new reader off the log directory $r = JLog::Reader->new($log); # open the log as the indicated subscriber $r->open($subscriber); while(my $line = $r->read) { # work with $line } # mark the seen records as read $r->checkpoint; or use JLog::Reader; $r = JLog::Reader->new($log); $r->open($subscriber); # mark lines read as they are pulled off the queue $r->auto_checkpoint(1); while(my $line = $r->read) { # work with $line } DESCRIPTIONJLog::Reader allows you to access a jlog queue for reader.INTERFACEConstructornew$w = JLog::Reader->new( $path_to_jlog, [ $flags [, $size ] ] ); Instantiates a JLog writer object associated with the JLog directory.
Subscriber ManagementThese functions are inherited from JLogadd_subscriber $w->add_subscriber( $name, [ $flag ] ); Add a subscriber to the JLog queue.
remove_subscriber $w->remove_subscriber ( $name ); Remove a subscriber to the JLog queue.
Reading From The Queueopen$w->open( $subscriber_name ); Opens the JLog for reading.
read $message = $w->read; Read the next message from the JLog queue. checkpoint $r->checkpoint; Checkpoint your read. This will notify the JLog that you have successfully read logs up to this point. If all registered subscribers have read to a certain point, the JLog system can remove the underlying data for the read messages. auto_checkpoint( [ $val ] )Returns (and optionally sets) the auto_checkpoint property. With auto-checkpointing enabled, JLog::Reader will automatically checkpoint whenever you call read().
Internalsalter_journal_size$r->alter_journal_size( $size ); Set the size of the individual journal files.
raw_size $size = $r->raw_size; The size of the existing journal (including checkpointed but unpurged messages in the current journal file), in bytes. $r->rewind; Rewind the jlog to the previous transaction id (when in an uncommitted state). This is useful for implementing a 'peek' style action. SEE ALSOJLog JLog::WriterCOPYRIGHTCopyright (C) 2006-2008 by Message Systems, Inc.POD ERRORSHey! The above document had some coding errors, which are explained below:
Visit the GSP FreeBSD Man Page Interface. |