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::WRITER (3)

.ds Aq ’

NAME

JLog::Writer - Perl extension for writing to a jlog journal.

CONTENTS

SUMMARY



  use JLog::Writer;
  use Fcntl qw/:DEFAULT/;
 
  my $sub = "testsubscriber";
  my $log = "foo.jlog";
 
  # open a log - this respects stander Fcntl flags
  my $w = JLog::Writer->new($log, O_CREAT);
 
  # add a subscriber - without this there is danger that
  # a log may be expired without the unnamed subscriber
  # stating its intention to read.
  $w->add_subscriber($sub);
 
  # open for writing
  $w->open;
 
  foreach (1 ... 3) {
    # write to the queue
    $w->write("foo $_");
  }
  # close the queue
  $w->close;



DESCRIPTION

JLog::Writer allows you to access a jlog queue for writing.

INTERFACE

    Constructor

new



  $w = JLog::Writer->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.

    Writing to the Queue

open



  $w->open();



Opens the JLog for writing.

write



  $w->write( $message [, $ts ] );



Write a message to the JLog.
$message The message to write.
$ts The timestamp (in epoch seconds) to set the record timestamp to. The default is time().

    Internals

alter_journal_size



  $w->alter_journal_size( $size );



Set the size of the individual journal files.
$size The desired size in bytes.
raw_size



  $size = $w->raw_size;



The size of the existing journal (including checkpointed but unpurged messages in the current journal file), in bytes.

SEE ALSO

JLog JLog::Reader

COPYRIGHT AND LICENSE

Copyright (C) 2006-2008 by Message Systems, Inc.
Search for    or go to Top of page |  Section 3 |  Main Index


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

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