question : async_psycopg2 and stormed-amqp

39 views
Skip to first unread message

bino_oetomo

unread,
May 24, 2012, 11:30:31 AM5/24/12
to Tornado Web Server
Dear all

This is my first day to Tornado

I try to find solution to write async RabbitMQ client
I read https://github.com/paolo-losi/stormed-amqp/blob/master/examples/tutorial3/receive_logs.py
I made a copy of that example ... do a litle adjustment to suit my
RabbitMQ, and it works

Now .. I want to not just printout the received msg, I want to dump it
to my Postgres.
Since I know a bit about psycopg2, I found https://gist.github.com/861193,
and
it's example is at https://gist.github.com/861193.js?file=example.py

But I think the style between stormed-amqp's example and the
async_psycopg2 is diferent for me. Lookslike:
a. the stormed-amqp sample is NOT a 'web-server'
b. the async_psycopg2 sample IS a 'web-server'

So, my question is :
1. How to add async_psycopg2 module to existing Tornado installation ?
2. Based on refered stormed-amqp example, what I have todo if I want
INSERT the msg to my postgres ?
Note :
a. Let's say I want to do the query at line 21 of the stormed-amqp
example above.
b. dbname = myDB, tablename = myTable, columnname = myColumn

Kindly please give me your enlightment.

Sincerely
-bino-

Frank Smit

unread,
May 24, 2012, 7:26:10 PM5/24/12
to python-...@googlegroups.com
About async_psycopg2. The code in the gist was just a test. Use
Momoko: http://momoko.61924.nl/ . Momoko is a fully working Psycopg2
wrapper for Tornado and has documentation.
Reply all
Reply to author
Forward
0 new messages