librelist archives

« back to archive

Gevent support

Gevent support

From:
Matthew Hawn
Date:
2012-01-25 @ 20:23
Does wsgid have support for running under gevent?

Thanks,
Matt

Re: [wsgid] Gevent support

From:
Dalton Barreto
Date:
2012-01-26 @ 11:53
2012/1/25 Matthew Hawn <steamraven@yahoo.com>:
> Does wsgid have support for running under gevent?
>

Hello Matt,

Thanks for your interest in wsgid. Currently there is no support for
gevent. The current model
of wsgid is one process handling one request at a time.

But yesterday I was reading about gevent and 0MQ and found one project
that could help
to support gevent. It's gevent-zeromq [1]. What this project seems to
do is to make all blocking
operations of zemprq to block only the current greenlet and not the
whole thread.

And it seems also to be fully compatible with the interface exposed by
pyzmq (used by wsgid, currently).
Maybe the first setp will be to change "import zmq" to "from
gevent_zeromq import zmq" and then
start creating greenlets to handle requests.

if you want, you can open an github issue so when can start thinking
about how to implement multiple
"execution methods" in wsgid. Maybe a new CLI option
--exec-method={gevent,worker,etc} and then
wsgid would behave appropriately.

What do you think?

[1] https://github.com/traviscline/gevent-zeromq

Thank you very much.

-- 
Dalton Barreto
http://daltonmatos.com

Re: [wsgid] Gevent support

From:
Matthew Hawn
Date:
2012-01-27 @ 17:40
Thanks for the response.  I was trying to find a good wsgi library for 
Mongrel2.  I also found m2wsgi, but wsgid seems to be better quality. 
However, I do need to use greenlets(gevent) and was hoping wsgid supported
them out of the box.

As for using gevent-zeromq, that is definately a start. You will probably 
want to create a new greenlet for each connection (with probably a 
maximum). You also probably just want 1 thread per process


I will keep watching wsgid. Thanks,


Matt


________________________________
 From: Dalton Barreto <daltonmatos@gmail.com>
To: wsgid@librelist.com 
Sent: Thursday, January 26, 2012 4:53 AM
Subject: Re: [wsgid] Gevent support
 
2012/1/25 Matthew Hawn <steamraven@yahoo.com>:
> Does wsgid have support for running under gevent?
>

Hello Matt,

Thanks for your interest in wsgid. Currently there is no support for
gevent. The current model
of wsgid is one process handling one request at a time.

But yesterday I was reading about gevent and 0MQ and found one project
that could help
to support gevent. It's gevent-zeromq [1]. What this project seems to
do is to make all blocking
operations of zemprq to block only the current greenlet and not the
whole thread.

And it seems also to be fully compatible with the interface exposed by
pyzmq (used by wsgid, currently).
Maybe the first setp will be to change "import zmq" to "from
gevent_zeromq import zmq" and then
start creating greenlets to handle requests.

if you want, you can open an github issue so when can start thinking
about how to implement multiple
"execution methods" in wsgid. Maybe a new CLI option
--exec-method={gevent,worker,etc} and then
wsgid would behave appropriately.

What do you think?

[1] https://github.com/traviscline/gevent-zeromq

Thank you very much.

-- 
Dalton Barreto
http://daltonmatos.com

Re: [wsgid] Gevent support

From:
Dalton Barreto
Date:
2012-01-27 @ 17:52
2012/1/27 Matthew Hawn <steamraven@yahoo.com>:
> Thanks for the response.  I was trying to find a good wsgi library for
> Mongrel2.  I also found m2wsgi, but wsgid seems to be better quality.
> However, I do need to use greenlets(gevent) and was hoping wsgid supported
> them out of the box.
>
> As for using gevent-zeromq, that is definately a start. You will probably
> want to create a new greenlet for each connection (with probably a maximum).
> You also probably just want 1 thread per process
>

Thanks for the tips. Do you know any other library that could help
using zeromq with gevent?

> I will keep watching wsgid. Thanks,
>

Thank you.


-- 
Dalton Barreto
http://daltonmatos.com