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

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

Serving Software Downloads in 976 Categories, Downloaded 29.548.788 Times

Queue::Dir 0.01

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

Queue::Dir

Report Broken Link
Printer Friendly Version


Product Homepage
Download (18 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  
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  -  Copying and Pasting Directories and Files 1.0
This scriptpresents afew 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 from...
 
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...
 
Audio Tools  -  The Music File Finder (muff) 0.3
The Music File Finder (muff) is a shell program (bash) to search a directory tree for mp3 files whose filename matches some regular expression. Users are presented a list of matching filenames and can choose any of these file to be appended to a...
30.72 KB  
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...
 
NEW DOWNLOADS IN LINUX SOFTWARE, PROGRAMMING
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  
Linux Software  -  SLAX 6.0+
Slax is a modern, portable, small and fast Linux operating system with a modular approach and outstanding design. Despite its small size, Slax provides a wide collection of pre-installed software for daily use, including a well organized graphical...
190 KB  
Linux Software  -  GTK+ 2.5
GTK+, which stands for the GIMP Toolkit, is a library for creating graphical user interfaces for the X Window System. It is designed to be small, efficient, and flexible. GTK+ is written in C with a very object-oriented approach. Language bindings...
60 MB  
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 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  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB