Re: [Haskell-cafe] [GSoC] Student applications deadline extended one week

2008-04-01 Thread Manlio Perillo

Adam Langley ha scritto:

On Mon, Mar 31, 2008 at 12:00 PM, Manlio Perillo
<[EMAIL PROTECTED]> wrote:

 Since Nginx is asynchronous, how can be solved the producer-consumer
 problem (that is, the Haskell program produces more data that Nginx can
 send to the client without blocking)?


I assume that the Haskell process is connected to nginx over a pipe or
socket. 


No, the idea is to have the Haskell application embedded in nginx.


In which case, nginx can use flow control to block the sending
side of the pipe and the Haskell code will backup on that.

If many connections need to be multiplexed over the same
flow-controlled entity (i.e. a pipe), without head-of-line blocking
then you can just suspend the current thread using an MVar or the STM
objects.

Alternatively, with Network.MiniHTTP the problem is turned inside out.
Request handlers give return a Source object, which can be asked to
generate more data on request. This would be similar to generators in
Python.



This (the first suggestion) seems very interesting, thanks.




AGL




Manlio Perillo
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [GSoC] Student applications deadline extended one week

2008-03-31 Thread Adam Langley
On Mon, Mar 31, 2008 at 12:00 PM, Manlio Perillo
<[EMAIL PROTECTED]> wrote:
>  Since Nginx is asynchronous, how can be solved the producer-consumer
>  problem (that is, the Haskell program produces more data that Nginx can
>  send to the client without blocking)?

I assume that the Haskell process is connected to nginx over a pipe or
socket. In which case, nginx can use flow control to block the sending
side of the pipe and the Haskell code will backup on that.

If many connections need to be multiplexed over the same
flow-controlled entity (i.e. a pipe), without head-of-line blocking
then you can just suspend the current thread using an MVar or the STM
objects.

Alternatively, with Network.MiniHTTP the problem is turned inside out.
Request handlers give return a Source object, which can be asked to
generate more data on request. This would be similar to generators in
Python.


AGL

-- 
Adam Langley [EMAIL PROTECTED] http://www.imperialviolet.org
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [GSoC] Student applications deadline extended one week

2008-03-31 Thread Manlio Perillo

Don Stewart ha scritto:

Hey all,

As you might know, the Google Summer of Code application submission
period is open. Google has decided to extend the deadline for initial
student applications by one week,


http://groups.google.com/group/google-summer-of-code-announce/browse_thread/thread/9fa88f31aa401f70

If you've thought about submitting, and are interested in hacking on
Haskell for 3 months this summer, and bootstrapping into the Haskell
developer community, check our project wiki,

http://hackage.haskell.org/trac/summer-of-code/wiki/SoC2008

and get your applications into google this week!

-- Don




Hi.
I'm very new to Haskell.


From the SoC2008 page I see that there is a project for working on a 
mod_haskell for Apache.


Now, I'm the author of the WSGI (Python Web Server gateway Interface) 
module for Nginx:


http://hg.mperillo.ath.cx/nginx/mod_wsgi/


I'm thinking about writing an Haskell module for Nginx, for learning 
purpose.


I'm not a student, so this is not a SoC2008 proposal, but I'm very 
interested in related works.



As an example, how should be a CGI like interface for Haskell?


Since Nginx is asynchronous, how can be solved the producer-consumer 
problem (that is, the Haskell program produces more data that Nginx can 
send to the client without blocking)?


I have easily solved this in Python, since the WSGI application returns 
a generator and I can simply suspend the iteration.



Is it possible to support asynchronous Haskell applications (as an 
example an application that needs to do a HTTP request to a server 
without blocking the worker process)?


Here, again, I have solved the problem for Python by making use of 
generators:

http://hg.mperillo.ath.cx/nginx/mod_wsgi/file/tip/examples/nginx-postgres-async.py

(but this is very experimental)




Thanks and sorry for having used this thread for an unrelated topic
(I have removed the Cc to haskell-soc-2008)



Manlio Perillo
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] [GSoC] Student applications deadline extended one week

2008-03-31 Thread Don Stewart
Hey all,

As you might know, the Google Summer of Code application submission
period is open. Google has decided to extend the deadline for initial
student applications by one week,


http://groups.google.com/group/google-summer-of-code-announce/browse_thread/thread/9fa88f31aa401f70

If you've thought about submitting, and are interested in hacking on
Haskell for 3 months this summer, and bootstrapping into the Haskell
developer community, check our project wiki,

http://hackage.haskell.org/trac/summer-of-code/wiki/SoC2008

and get your applications into google this week!

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe