The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Glist Queue Tracking and Spool Priority

WHAT

You should be able to track where a spool file is in the queue.  
You should also be able to put it on hold, remove it and 
raise/lower the priority.

A spool file can have any name and it's sorted first by 
alphanumeric characters then by ascending numbers.

New spool files are created with a name built up by a 
concatenated string of the localtime and <= 8 random digits.
This means that all we have to do to raise/lower
priority is to raise/lower the values of the filename
until it's the first file sorted in the list.

Sendd should check if the spoolentry is still in the
spooldb after each sent chunk, if not it should stop sending.

WHERE

The queue information should be stored in a dbm file.
This file should be in var/run/queue.db.

The key in this db is the filename, and the value
is split up by pipes ('|') and has the following syntax:
string spool|int prio|bool hold|string pointer
If the pointer field exists this means that this file
has moved and we should fetch the new filename instead.

HOW

This is the list of functions we need to implement	
queue tracking and priorities in glist.
bool gtr_introduce(string filename)
Introduce a new file in the queue. Returns true if 
successful and false if there is already a file with 
this name in the queue.
string gtr_setpos(string filename, string spool)
Move the file to a new queue.
Returns the new queuename.
string gtr_rename(string old, string new)
Rename a file. Should also be used by gtr_raise and gtr_lower
as well. The old queuedb entry is not deleted, but we make a pointer
to the new one instad.
Returns the new filename.
string gtr_getpos(string filename);
Get the current position of a spoolfile, should follow
pointers as well.
string gtr_raise(string filename);
Raise the priority of a file by renaming it so it
will be the first in the sort algo.
string gtr_lower(string filename);
Lower the priority of a file by renaming it so it
will be the last in the sort algo.
bool gtr_delete(string filename);
Delete a file in the queue.
bool gtr_stop(string filename);
Put a file on hold. That means moving it to the hold queue,
and setting the hold flag.
bool gtr_restart(string filename);
Move the file out of the hold queue into it's previous queue
and unset the hold flag.
=back

AUTHOR

Ask Solem Hoel <ask@unixmonks.net>

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 1:

=cut found outside a pod block. Skipping to next block.

Around line 101:

You forgot a '=back' before '=head1'