Python / Ice / Asynchronous Questions

Ice/DBus, Web-Interfaces, Management tools

Python / Ice / Asynchronous Questions

Postby darkman802 » Fri May 16, 2014 5:18 am

I've never done anything with Python that would be considered asynchronous / concurrent, so I'm having some trouble understanding if this project I have in mind will work or not.

I was thinking about getting real time events from murmur servers, sending them to rabbitmq (which is a messaging broker), and then consuming the events in different ways.

To do that I would use Python to subscribe to the ice events of the virtual servers. The part I'm not sure how will work is when I want events from multiple virtual servers.
Since I don't think Python is asynchronous by default, how would I connect to multiple virtual servers, and what would happen if multiple events were sent at the same time?
Would it "just work", or would python ignore some of the events because it can only do one thing at a time?
darkman802
 
Posts: 7
Joined: Fri May 16, 2014 5:12 am

Re: Python / Ice / Asynchronous Questions

Postby jjjidea » Sat May 17, 2014 4:02 pm

if you use python 2, i think you can use twisted that xcan manage asynchronous events
jjjidea
 
Posts: 13
Joined: Mon May 16, 2011 5:22 pm

Re: Python / Ice / Asynchronous Questions

Postby darkman802 » Sat May 17, 2014 8:07 pm

I believe ice supports some sort of asynchronous operations, but I'm just not sure if it does what I'm wanting it to do. The idea is to subscribe to the events of multiple virtual servers and when an event/callback is received, to push that event into rabbitmq using the python library pika https://github.com/pika/pika.

Another question comes up when pika is introduced because in the examples for an asynchronous publisher http://pika.readthedocs.org/en/0.9.13/examples/asynchronous_publisher_example.html, it uses an io loop to respond to events from rabbitmq (such as to reconnect if it receives a disconnected event).

I'm not sure what I would need to do to to get ice working with pika. I assume ice uses some kind of io loop because one of the ice commands you usually call is
Code: Select all
communicator.waitForShutdown()
or something similar to that.
Since there seems to be two event loops in the fray I'm not sure if they would work together, or what I would need to do to get them to work.
darkman802
 
Posts: 7
Joined: Fri May 16, 2014 5:12 am


Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest

cron