darkman802 Posted May 16, 2014 Share Posted May 16, 2014 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? Link to comment Share on other sites More sharing options...
jjjidea Posted May 17, 2014 Share Posted May 17, 2014 if you use python 2, i think you can use twisted that xcan manage asynchronous events Link to comment Share on other sites More sharing options...
darkman802 Posted May 17, 2014 Author Share Posted May 17, 2014 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 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now