Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #32124

Re: Question about long-running web scripts

Date 2012-10-25 14:24 +0100
From Tim Golden <mail@timgolden.me.uk>
Subject Re: Question about long-running web scripts
References <nm8i889v1p5orgk4dkvtcurguk11lvm6r8@4ax.com> <mailman.2838.1351166605.27098.python-list@python.org> <skci88lm21ldghic8k4leo8n6tminmam5l@4ax.com>
Newsgroups comp.lang.python
Message-ID <mailman.2840.1351171460.27098.python-list@python.org> (permalink)

Show all headers | View raw


On 25/10/2012 13:40, Gilles wrote:
> On Thu, 25 Oct 2012 13:03:14 +0100, Tim Golden <mail@timgolden.me.uk>
> wrote:
>> (Your question is a little confused at the end. I'm choosing to
>> understand: why can't we just run Python one-shot, like CGI? The likely
>> alternative meaning is: why can't the incoming request be routed to an
>> already-running Python program -- which is not, of course, what CGI
>> generally does. Hence my confusion).
> 
> Yes indeed. Sorry about the confusion.
> 
> But actually, I didn't mean one-shot scripts, where the Python
> interpreter + script must be loaded each time, but rather: If I leave
> a Python running in an endless loop, why not just use either CGI or
> some other basic way to call the script instead of FastCGI?

In essence, you're describing FastCGI. A Python program (or, indeed, any
program) which uses FastCGI runs continuously and waits for the incoming
request on a TCP socket (instead of as a sys.stdin stream + env vars
immediately after process startup).

The key description is here:

  http://www.fastcgi.com/drupal/node/6?q=node/15

(The sections have no anchors; you're looking for the section titled "2.
FastCGI Interface")

TJG

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Question about long-running web scripts Gilles <nospam@nospam.com> - 2012-10-25 13:45 +0200
  Re: Question about long-running web scripts Tim Golden <mail@timgolden.me.uk> - 2012-10-25 13:03 +0100
    Re: Question about long-running web scripts Gilles <nospam@nospam.com> - 2012-10-25 14:40 +0200
      Re: Question about long-running web scripts Tim Golden <mail@timgolden.me.uk> - 2012-10-25 14:24 +0100
        Re: Question about long-running web scripts Gilles <nospam@nospam.com> - 2012-10-26 11:58 +0200
          Re: Question about long-running web scripts Tim Golden <mail@timgolden.me.uk> - 2012-10-26 12:00 +0100
            Re: Question about long-running web scripts Gilles <nospam@nospam.com> - 2012-10-26 13:37 +0200
  Re: Question about long-running web scripts David Hutto <dwightdhutto@gmail.com> - 2012-10-25 08:53 -0400
    Re: Question about long-running web scripts Gilles <nospam@nospam.com> - 2012-10-26 11:56 +0200

csiph-web