Queue with tagged items

Category: Python - Miscellaneous

I needed multiple consumers to retrieve data from a queue fed by one producer. Could not find a good working code for that, so I implemented my own queue. Docstring should describe how this works.

Two notes:
1) my code uses multiprocessing code, but in this module, the Lock and Condition could be easily replaced with the same objects from the threading module
2) the attached test uses syntax for "nose" testing package, I did not convert it to doctest or UnitTest. Date: 10 March, 2012


Consumer - Producer - Queue - Tag

Homepage: http://code.activestate.com/recipes/576632-queue-with-tagged-items/?in=lang-python

Developer: Jirka Vejrazka

License: Freeware

Operating System: Windows

Add a Comment

all are required fields

     
What do you think of this resource?

Select Your Rate:

Votes:0

 

Related Scripts Download

Increase your international user base instantly.

developer Developer: preCharge Risk Managemen...
license License: Freeware
operating systems Operating System: Linux, Unix, Windows


MailBee Message Queue is a queue-based email-sending system which operates as a Windows NT service intercepting "send e-mail" requests from MailBee.

developer Developer: afterlogic.com
license License: Freeware
operating systems Operating System: All


MQS (Minimalist Queue Services) is a minimalist queueing system in Free Software.

developer Developer: foo.be
license License: Freeware
operating systems Operating System: All


This module provides a simple criteria-based priority queue with "priority cascading".

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


This script defines a scheduled queue: a queue with priorities that are scheduled.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


Quick and easy FIFO queue class is an easy First-In-First-Out queue class based on Python's List data structure.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


Priority queues are a kind of container that allows specification of the relative order of the data.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


Using espeak text to speech in Ubuntu, and the skype4py module, this will read out the contents of chat messages recieved-created to help me when away from my PC so if i have my hands full with the younger members of my family I can decide how urgent the chat is without having to go near the computer.

developer Developer: nigel spinney
license License: Freeware
operating systems Operating System: Windows


The precise rate of IRR( Internal Rate of Return ) is found using my program IRR-Versus-NPV, where I used the linear interpolation.

developer Developer: Fouad Teniou
license License: Freeware
operating systems Operating System: Windows