HappyDoc Generated Documentation unidist/messagequeue.py

unidist / messagequeue.py 

messagequeue

Message Queue management

TODO(g): Add auto-deleting options by count or age. Date tag their arrival in a dict so we can track stuff about it, and can maybe skip it.

TODO(g): Implement serialization, archiving, snapshotting, and replication to sharestate. This will allow us flexibility in many things. This is not necessarily going to be the best scaling solution, but it will work and provide a way to keep state and distribute. Name spaces should have this specified individually. If not specified, state will not be archived, serialized, snapshotted or replicated.

  • Use the "archive" and "snapshot" modules for this, so archival and snapshotting is universal. Ensure a process restart will do the right thing in attempting to restore from snapshot, then archive, if present.

    TODO(g): Merge achive and snapshot. They are the same technology. If we really want to keep state, then we must archive each transactions and snapshot to avoid having to replay too many archives.

Functions   
  GetMessageCount 
GetMessageCount ( queue )

Returns the number of messages in a queue.

Args: queue: string, name space for messages

Returns: int, number of messages in specified queue

  AddMessage 
AddMessage ( queue,  message )

Adds a message to a specified queue.

Args: queue: string, name space for messages message: any, data to store in queue

  GetMessage_Oldest 
GetMessage_Oldest ( queue,  remove=True )

Returns the oldest message in the queue(0).

Args: queue: string, name space for messages remove: boolean, remove the message from the queue?

  GetAllMessages 
GetAllMessages ( queue )

Returns all the messages in the queue, for inspection purposes.

Args: queue: string, name space for messages

  QueueExists 
QueueExists ( queue )

Does this queue exist?

Args: queue: string, name space for messages

Returns: boolean, True if queue namespace already exists

  GetMessage_Newest 
GetMessage_Newest ( queue,  remove=True )

Returns the oldest message in the queue(-1).

Args: queue: string, name space for messages remove: boolean, remove the message from the queue?

Classes   

This document was automatically generated Tue Aug 17 15:20:25 2010 by HappyDoc version 3.1