Directo...e::Null(3)

πŸ“¦
version 2.2 Β· 3 versions
, in epel 9

πŸŽ€ NAME πŸŽ€

Okay bestie, welcome to the Directo...e::Null(3) page β€” a whole User Contributed Perl Documentation moment β€” and today’s main character is Directory::Queue::Null: an object oriented interface to a null directory based queue. Periodt. πŸ’…


⭐ 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. Literally the queue version of β€œnot today, data.” 😌

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. Simple as that, bestie. πŸŽ€


🌈 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)
🫢 Friendly reminder: those error-returning methods are not being mean to you. The queue is always empty, so there is just nothing legitimate to call them on. It’s giving β€œempty group chat, no messages to react to.” 😭

πŸ“ DIRECTORY STRUCTURE πŸ“

This module does not store any file. Not one. Zero. The storage vibe is immaculate. πŸ¦‹


πŸ‘€ SEE ALSO πŸ‘€

Directory::Queue, Directory::Queue::Normal, Directory::Queue::Simple. Go read those too, iykyk. πŸ’–


πŸ’Œ AUTHOR πŸ’Œ

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

Copyright (C) CERN 2010-2022


πŸ’– Cute little sign-off, bestie: this page came from perl v5.32.1, dated 2022-07-20, and the footer energy is Directo...e::Null(3). Bye, love you, stay null and slay. πŸ’…βœ¨

πŸ“¦ where this page comes from