GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  JLOG::READER (3)

.ds Aq ’

NAME

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

CONTENTS

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( [ CW$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! <B>The above document had some coding errors, which are explained below:B>
Around line 181: Unknown directive: =head
Around line 188: =back without =over
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 JLOG::READER (3) 2015-01-22

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.