<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<blockquote
 cite="mid:21ee31950902181232g692e7caqa11a5d3cddbc7f77@mail.gmail.com"
 type="cite">
  <blockquote type="cite">
    <pre wrap="">[in Nginx]
- loop that checks every e.g. 0.001 secs to see if there are any responses
    </pre>
  </blockquote>
  <pre wrap=""><!---->
this is going to fail spectacularly.

  </pre>
</blockquote>
This was my gut instinct (it sounds a horrible idea) and is something I
wanted to avoid at all costs.<br>
It was more of a desperation attempt to not put things in an external
process.<br>
<br>
<blockquote
 cite="mid:21ee31950902181232g692e7caqa11a5d3cddbc7f77@mail.gmail.com"
 type="cite">
  <pre wrap="">what is the content generator? are you writing it from scratch? if it
connects to external sockets and doesn't use nginx's event loop or is
blocking  - it should be an external process and you should use an
upstream module. if you are writing from scratch (that is all of the
socket code too) you are possibly not on the wrong path (unlikely)
  </pre>
</blockquote>
Yes, as my understanding of the internals of Nginx are increasing, I
think I agree with you<br>
on this one. I am writing the content generator from scratch.<br>
<blockquote
 cite="mid:21ee31950902181232g692e7caqa11a5d3cddbc7f77@mail.gmail.com"
 type="cite">
  <pre wrap="">You should be talking via pipes/sockets to your content generator and
getting callbacks on those via the event loop.    And if you're
talking to another thread via pipes already you might as well save the
trouble and move it into its own process and use the already written
mature upstream modules. Just compiling a bunch of random code into
Nginx is not going to make it fast.  You either design it from the
ground up very carefully or use external processes.

  </pre>
</blockquote>
I think I've come round to the idea that you're right on this one.  I
think what I'm doing <br>
will be too messy to try to get it working inside Nginx, even though
I'd prefer to do it that<br>
way. I'm looking at both FastCGI and a customized format which I'd use
with the upstream<br>
module as possible solutions.<br>
</body>
</html>