From: Viatcheslav Gachkaylo <vgachka...@crystalnix.com>
Date: Thu, 1 Nov 2012 18:12:49 +0600
Local: Thurs, Nov 1 2012 8:12 am
Subject: Re: [gevent] Using greenlets in 2 separate threads
Hello, AM
In the end I decided to use multiprocessing to launch 2 separate processes with Pipe communication.
Thanks for your answer,
On Oct 31, 2012, at 10:01 PM, AM wrote:
> On 10/30/2012 11:25 PM, Viatcheslav Gachkaylo wrote:
>> Hello, >> I need to run 2 servers communicating with each other in a single process. One uses gevent event loop, the other one uses tornado.
>> The first server is gevent.wsgi.WSGIServer, the second one is https://github.com/thisismedium/python-xmpp-server/
>> --
> Hi Vitaly.
> If you want to run two servers in the same process, simply start the servers using start (not serve_forever) and wait on the two greenlet objects you get back. You will have to take care that when one of them terminates the other one terminates too, or else you may end up with only one server running.
> Re: tornado, it uses its own event loop based around the same apis that gevent uses but at a much lower level. In theory you might be able to make it work with greenlets, but you may end up recreating gevent :)
> I am wondering why two processes are not a good model?
> HTH
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||