cue

A simple queue abstraction along the lines of the command pattern
Download

cue Ranking & Summary

Advertisement

  • Rating:
  • License:
  • MIT/X Consortium Lic...
  • Price:
  • FREE
  • Publisher Name:
  • Charles Leifer
  • Publisher web site:
  • http://www.charlesleifer.com/blog/

cue Tags


cue Description

A simple queue abstraction along the lines of the command pattern cue is a simple queue abstraction along the lines of the command pattern.Example:some data needs to be propagated out of process:# somewhere in your app, define a commandclass ExpensiveCommand(QueueCommand): def execute(self): self.receiver.do_complicated_things() self.receiver.propagate_data()# don't want to clog up Apache, so push expensive# stuff to an out-of-process queuefrom cue.utils import Invokerdef some_view(request): # ... load up an object, etc invoker = Invoker() command = ExpensiveCommand(some_obj) invoker.enqueue(command)# a queue consumer somewhereinvoker.dequeue() # executes the commandInstallation:python setup.py installORput the cue folder on your python-pathGet queues: svn checkout http://queues.googlecode.com/svn/trunk/ queuesConfigure a queue backend to use and add to INSTALLED_APPS:# settings.pyQUEUE_BACKEND = 'redisd'QUEUE_REDIS_CONNECTION = 'localhost:6379'INSTALLED_APPS = Dependenciesqueues: svn checkout http://queues.googlecode.com/svn/trunk/ queues Requirements: · Python


cue Related Software