Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.215.736 Times

Queue::Dir 0.01

Company: Luis E. Mu?“A±oz
Date Added: November 14, 2013  |  Visits: 537

Queue::Dir

Report Broken Link
Printer Friendly Version


Product Homepage
Download (40 downloads)



Queue::Dir allows the manipulation of objects placed in a queue. The queue is implemented as a directory where each object is stored as a file.<br />METHODS<br /><br />The following methods are defined:<br /><br />my $q = new Queue::File (...)<br /><br /> -id assigns a unique process-id to this queue object. Defaults to something built from the serialization of the object + $$ or something similar.<br /><br /> -paths specifies a list of paths to use as storage points for the queue files. If more than one are supplied, round-robin will be used to store objects there.<br /><br /> When -promiscuous is true (the default), objects stored with any other Queue::File object are accessible. If set to false, only files whose id matches the value for -id are visible.<br /><br /> -sort allows for the specification of a sorting function, used to decide the order in which the queue files will be used. The function is invoked in the same fashion as sort, getting two variables ($a and $b) and returning -1, 0 or 1 depending on comparison. $a and $b are hash references whose first element is the queue id of the object and the second element is a the full pathname of such object.<br /><br /> The sub { ... } passed in the -filter parameter can control which files in a given directory to consider as queue objects. By default, all files will be considered part of the queue. This function is called with a reference of the invoking object and the full pathname of each file. A true return value causes the given file to be included in the queue. Note that this is only called if -promiscuous is set to a false value.<br /><br /> -lockdir and -lockmax control an optional locking mechanism that reduces the chance of multiple collaborating instances of Queue::Dir objects, from picking the same object from the queue. -lockdir, when present, defines the name of the directory (within each queue directory) to use for storing the lock files. The -lockmax parameter, which defaults to 300 seconds, control for how long the locks are honored.<br /><br /> Note that locking is disabled by default.<br />my ($fh, $qid) = $q->store();<br /><br /> Store a file in the queue. Returns an array whose first element is an IO::Handle object for writing to the file. The second element is the identifier of the object in the queue.<br /><br /> If you created the Queue::Dir object with locking enabled, you must call ->unlock after closing the file handle.<br />my $qid = $q->next();<br /><br /> Returns the queue identifier of the next file to be processed. When the queue is empty, returns undef.<br /><br /> Note that if multiple consumers are working on the same queues in promiscuous mode, the file referenced by the returned id might be removed at any time so care must be used.<br /><br /> Entries will be returned in an arbitrary order.<br />my $fh = $q->visit($mode, $qid);<br /><br /> On success, returns an IO::Handle object, opened according to the specified $mode for the file with $qid. If $mode is not specified, it defaults to a read from the start of the file. If $qid is not specified, it defaults to the next entry, as if ->next() were called. In order for the file to be eligible, either the Queue::Dir object is not created with locking enabled or the file in the queue is not locked.<br /><br /> It can fail in a number of situations. The obvious one, is when the queue is empty. The second one, happens when the desired file is no longer in the queue, which can happen if multiple consumers are accessing the queue in promiscuous mode.<br /><br /> To help disambiguate both scenarios, undef will be returned on an empty queue. A defined but false value will be returned when the desired file is missing but others remain in the queue.<br /><br /> The object in the queue will be automatically locked if this option is enabled when ->new was called. In this case, you should call the ->unlock method.<br />$q->done($qid);<br /><br /> Disposes the queue file whose $qid matches the given identifier as well as its potential lock. If none is specified, defaults to the last one used in a ->visit().<br /><br /> It is a bad idea (or at least rough manners) to unlink() the file without invoking ->done. Besides, ->done will do it for you.<br />my $fname = $q->name($qid);<br /><br /> Returns the full pathname of the queue file whose id matches $qid. If none is supplied, defaults to the last one obtained through a ->store(), ->next() or ->visit().<br /><br /> It could return undef is the queue object no longer exists.<br />->unlock($qid)<br /><br /> Removes any locks outstanding in the file identified by $qid, or the last visit()ed file. Use of this method is only required if the object is created with locking enabled.

Requirements: No special requirements
Platforms: *nix, Linux
Keyword: Called Defaults Directory Element Empty Enabled Files Locking Multiple Object Objects Promiscuous Queue Queuedir Returned
Users rating: 0/10

License: Freeware Size: 10.24 KB
USER REVIEWS
More Reviews or Write Review


QUEUE::DIR RELATED
Multimedia  -  ID3 Tagging Script 1.2
This module allows one to read and manipulate so-called ID3 informational tags on MP3 files through an object-oriented Python interface.
20.48 KB  
Image Galleries  -  ID3 Tagging 1.2
This module allows one to read and manipulate so-called ID3 informational tags on MP3 files through an object-oriented Python interface.
 
Libraries  -  OPML Writer 0.1
OPML Writer is a PHP4 class for writing OPML files with an object-oriented approach..
163.84 KB  
File Management  -  Copying and Pasting Directories and Files 1.0
This script presents a few basic fuctions that allow someone to copy a directory (along with its files and sub-directories) and paste it somewhere else. They ignore links and anything else that is not a directory or a file. The data returned...
 
Audio Tools  -  Menu Buddy 0.0.2
Menu Buddy plugin currently comprises a couple of Python scripts for creating GNOME panel menus from a directory hierarchy of music files. These menus can be used to play or enqueue songs in XMMS, as well as pause or skip XMMS. These scripts...
3.07 KB  
File Management  -  Recursive directory listing in HTML 1.1
This script contains a function that walks a directory path, listing the files and directories in HTML format. It can sometimes be handy to get a look at an entire directory tree, and HTML is a good way to display it. This script goes through the...
 
Utilities  -  tvrenamr 3.2.1
TV Renamr is a utility to rename TV shows based upon filenames or user input. Installation Python Package Index Make sure you have the python setuptools package installed for your version of python (check with python...
10.24 KB  
Audio Tools  -  findmp3 0.7
findmp3 is a program that searches through directory trees for mp3-files. This information is retrieved from the id3(v2) tags in an mp3-file. The syntax of the commandline is very similar to that of the find command. Whats New in This Release:...
16.38 KB  
File Utilities  -  FileMess New
The FileMess application was developed to be a small utility which scans a directory structure and moves files based on pattern matching. The FileMess utility was developed to tidy up the files downloaded from news servers (USENET). The program...
 
FTP Clients  -  AFD 1.3.5
AFD comes from Automatic File Distributor and provides a framework for very flexible, non-stop, log and debug-able delivery of an arbitrary amount of files to multiple recipients as expressed in URLs (currently mailing and ftp supported with the...
1.1 MB  
NEW DOWNLOADS IN LINUX SOFTWARE, PROGRAMMING
Linux Software  -  EasyEDA PCB Designer for Linux 2.0.0
EasyEDA, a great web based EDA(Electronics Design Automation) tool, online PCB tool, online PCB software for electronics engineers, educators, students, makers and enthusiasts. Theres no need to install any software. Just open EasyEDA in any...
34.4 MB  
Linux Software  -  wpCache® WordPress HTTP Cache 1.9
wpCache® is a high-performance, distributed object, caching system application, generic in nature, but intended for use in speeding up dynamic web applications, by decreasing database load time. wpCache® decreases dramatically the page...
3.51 MB  
Linux Software  -  Polling Autodialer Software 3.4
ICTBroadcast Auto Dialer software has a survey campaign for telephone surveys and polls. This auto dialer software automatically dials a list of numbers and asks them a set of questions that they can respond to, by using their telephone keypad....
488 B  
Linux Software  -  Total Video Converter Mac Free 3.5.5
Total Video Converter Mac Free developed by EffectMatrix Ltd is the official legal version of Total Video Converter which was a globally recognized brand since 2006. Total Video Converter Mac Free is a free but powerful all-in-one video...
17.7 MB  
Linux Software  -  Skeith mod_log_sql Analyzer 2.10beta2
Skeith is a php based front end for analyzing logs for Apache using mod_log_sql.
47.5 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB