Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
JLog::Reader(3)	      User Contributed Perl Documentation      JLog::Reader(3)

NAME
       JLog::Reader - Perl extension for reading to a jlog journal.

SUMMARY
	 use 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
	 }

DESCRIPTION
       JLog::Reader allows you to access a jlog	queue for reader.

INTERFACE
   Constructor
       new

	 $w = JLog::Reader->new( $path_to_jlog,	[ $flags [, $size ] ] );

       Instantiates a JLog writer object associated with the JLog directory.

       $path_to_jlog
	   The directory for the JLog queue.

       $flags
	   Optional flags, from	'Fcntl'.  The default is O_CREAT.

       $size
	   Optional size of the	individual journal files.

   Subscriber Management
       These functions are inherited from JLog

       add_subscriber

	 $w->add_subscriber( $name, [ $flag ] );

       Add a subscriber	to the JLog queue.

       $name
	   The name of the subscriber.

       $flag
	   An optional flag dictating where the	subscriber should be marked
	   interested from.  The default is JLog::JLOG_BEGIN.  The other
	   available option is JLog::JLOG_END.

       remove_subscriber

	 $w->remove_subscriber ( $name );

       Remove a	subscriber to the JLog queue.

       $name
	   The name of the subscriber.

   Reading From	The Queue
       open

	 $w->open( $subscriber_name );

       Opens the JLog for reading.

       $subscriber_name
	   The name we want to subscribe under.	 This must previously have
	   been	registered as a	log subscriber via add_subscriber().

       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().

       $val
	   The value you wish to set auto_checkpointing	to.

   Internals
       alter_journal_size

	 $r->alter_journal_size( $size );

       Set the size of the individual journal files.

       $size
	   The desired size in bytes.

       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 ALSO
       JLog JLog::Writer

COPYRIGHT
       Copyright (C) 2006-2008 by Message Systems, Inc.

POD ERRORS
       Hey! The	above document had some	coding errors, which are explained
       below:

       Around line 181:
	   Unknown directive: =head

       Around line 188:
	   =back without =over

perl v5.32.0			  2015-01-22		       JLog::Reader(3)

NAME | SUMMARY | DESCRIPTION | INTERFACE | SEE ALSO | COPYRIGHT | POD ERRORS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=JLog::Reader&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help