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
JLog::Writer(3) User Contributed Perl Documentation JLog::Writer(3)

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

  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;

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

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.

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.

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

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.

JLog JLog::Reader

Copyright (C) 2006-2008 by Message Systems, Inc.
2015-01-22 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

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