Path: csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'callback': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:How': 0.10; 'mostly': 0.14; '(read': 0.16; 'blocked': 0.16; 'blocking': 0.16; 'handlers.': 0.16; 'message-id:@4ax.com': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:non': 0.16; 'timeout': 0.16; 'timeout)': 0.16; 'subject: ?': 0.16; 'feb': 0.22; 'url:home': 0.24; 'world,': 0.26; 'defined': 0.27; 'header:X-Complaints-To:1': 0.27; 'external': 0.29; 'programming.': 0.30; 'code': 0.31; '+0200,': 0.36; 'skip:> 10': 0.36; 'done': 0.36; 'charset:us-ascii': 0.36; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; '2015': 0.84; 'aka': 0.91; 'expires': 0.91; 'subject:skip:S 20': 0.91; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: How to write a non blocking SimpleHTTPRequestHandler ? Date: Tue, 03 Feb 2015 20:25:52 -0500 Organization: IISS Elusive Unicorn References: <47031e69-e94d-4257-8c7d-e7c00a543634@googlegroups.com> <874mr3ibve.fsf@elektro.pacujo.net> <87r3u7grd3.fsf@elektro.pacujo.net> <87iofjglbg.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 108.73.116.218 X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1423013153 news.xs4all.nl 2834 [2001:888:2000:d::a6]:53152 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:85188 On Tue, 03 Feb 2015 15:45:55 +0200, Marko Rauhamaa declaimed the following: >Now I think you might have some misconceptions about nonblocking >networking I/O. Nonblocking I/O is done using asynchronous, or >event-driven, programming. Your code reacts to external stimuli, never >blocking, mostly just sleeping. The reactions are defined in callback >routings, aka listeners, aka event handlers. > In my world, "sleep" is a blocking operation -- the process is blocked from execution until the sleep expires or is otherwise canceled. So a socket.select() with timeout is a blocking operation -- just that it is released when any of the multiple items (read sockets, write sockets, timeout) is satisfied. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/