Metadata-Version: 1.0
Name: python-q4m
Version: 0.0.4
Summary: Q4M operation wrapper
Home-page: http://github.com/cubicdaiya/python-q4m
Author: Tatsuhiko Kubo (cubicdaiya@gmail.com)
Author-email: cubicdaiya@gmail.com
License: GPL2
Description: 
           This module is simple Q4M operation wrapper developed by pixiv Inc. for asynchronous upload system
        
           Simple example of usage is followings
        
           >>> from python_q4m.q4m import *
           >>> class QueueTable(Q4M):
           >>>     def __init__(self, con):
           >>>         super(self.__class__, self).__init__(con)
           >>>         self.table   = 'queue_table'
           >>>         self.columns = ['id',
           >>>                         'msg',
           >>>                        ]
           >>> try:
           >>>    con = MySQLdb.connect(host='localhost',
           >>>                          db=dbname,
           >>>                          user=username,
           >>>                          passwd=password,
           >>>                         )
           >>>    q = QueueTable(con)
           >>>    q.enqueue([1, 'msg'])
           >>>    while q.wait() == 0:
           >>>        time.sleep(1);
           >>>     res = q.dequeue()
           >>>     print res['id']
           >>>     print res['msg']
           >>>     q.end()
           >>> except MySQLdb.Error, e:
           >>>     print 'Error %d: %s' % (e.args[0], e.args[1])
           >>>     q.abort()
           >>>     con.close()
           
           And it is necessary to create following table for above example
           
               CREATE TABLE `queue_table` (
                   `id` int(11) NOT NULL,
                   `msg` text NOT NULL
               ) ENGINE=QUEUE;
        
Keywords: q4m,mysql,queue
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development :: Libraries :: Python Modules
