NAME

Directory::Queue::Null - object oriented interface to a null directory based queue

SYNOPSIS

use Directory::Queue::Null;
$dirq = Directory::Queue::Null->new();
foreach $count (1 .. 100) {
    $name = $dirq->add(... some data ...);
}

DESCRIPTION

The goal of this module is to offer a "null" queue system using the same API as the other directory queue implementations. The queue will behave like a black hole: added data will disappear immediately so the queue will therefore always appear empty.

This can be used for testing purposes or to discard data like one would do on Unix by redirecting output to /dev/null.

Please refer to Directory::Queue for general information about directory queues.

CONSTRUCTOR

The new() method can be used to create a Directory::Queue::Null object that will later be used to interact with the queue. No attributes are supported.

METHODS

The following methods are available:

new()

return a new Directory::Queue::Null object (class method)

copy()

return a copy of the object

path()

return the queue toplevel path, that is NULL

id()

return a unique identifier for the queue, that is NULL

count()

return the number of elements in the queue, so always 0

first()

return the first element in the queue, so always an empty string

next()

return the next element in the queue, so always an empty string

add(DATA)

add the given data (it can be anything) to the queue, this does nothing

add_ref(REF)

add the given data reference to the queue, this does nothing

add_path(PATH)

add the given file (identified by its path) to the queue, this will therefore remove the file

purge()

purge the queue, this does nothing

The following methods are available to provide the same API as the other directory queue modules but they will always return an error as they cannot be legitimately called since the queue is always empty:

lock(ELEMENT)
unlock(ELEMENT)
touch(ELEMENT)
remove(ELEMENT)
get(ELEMENT)
get_ref(ELEMENT)
get_path(ELEMENT)

DIRECTORY STRUCTURE

This module does not store any file.

SEE ALSO

Directory::Queue, Directory::Queue::Normal, Directory::Queue::Simple.

AUTHOR

Lionel Cons http://cern.ch/lionel.cons

Copyright (C) CERN 2010-2022