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


Groups > comp.lang.python > #72594

Re: Benefits of asyncio

Date 2014-06-04 08:10 +0300
From Burak Arslan <burak.arslan@arskom.com.tr>
Subject Re: Benefits of asyncio
References (5 earlier) <mailman.10606.1401785234.18130.python-list@python.org> <87wqcyuznv.fsf@elektro.pacujo.net> <CAPTjJmpARfzmT76m-LRbrj0jcr7fq+dRD5ooprr25BufmM=pAQ@mail.gmail.com> <538DABE0.1070902@arskom.com.tr> <CAPTjJmpd_Tq2UpYE4tzbJSr-ZLp2KdNCJoTi1y_YQtmrz9sMpA@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.10678.1401858648.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 03/06/14 14:57, Chris Angelico wrote:
> On Tue, Jun 3, 2014 at 9:05 PM, Burak Arslan <burak.arslan@arskom.com.tr> wrote:
>> On 06/03/14 12:30, Chris Angelico wrote:
>>> Write me a purely nonblocking
>>> web site concept that can handle a million concurrent connections,
>>> where each one requires one query against the database, and one in a
>>> hundred of them require five queries which happen atomically.
>>
>> I don't see why that can't be done. Twisted has everyting I can think of
>> except database bits (adb runs on threads), and I got txpostgres[1]
>> running in production, it seems quite robust so far. what else are we
>> missing?
>>
>> [1]: https://pypi.python.org/pypi/txpostgres
> I never said it can't be done. My objection was to Marko's reiterated
> statement that asynchronous coding is somehow massively cleaner than
> threading; my argument is that threading is often significantly
> cleaner than async, and that at worst, they're about the same (because
> they're dealing with exactly the same problems).

Ah ok. Well, a couple of years of writing async code, my 
not-so-objective opinion about it is that it forces you to split your 
code into functions, just like Python forces you to indent your code 
properly. This in turn generally helps the quality of the codebase.

If you manage to keep yourself out of the closure hell by not writing 
more and more functions inside one another, I say async code and 
(non-sloppy) blocking code looks almost the same. (which means, I guess, 
that we mostly agree :))

Burak

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


Thread

Benefits of asyncio Aseem Bansal <asmbansal2@gmail.com> - 2014-06-02 10:40 -0700
  Re: Benefits of asyncio Ian Kelly <ian.g.kelly@gmail.com> - 2014-06-02 12:37 -0600
  Re: Benefits of asyncio Terry Reedy <tjreedy@udel.edu> - 2014-06-02 16:07 -0400
    Re: Benefits of asyncio Roy Smith <roy@panix.com> - 2014-06-02 16:19 -0400
    Re: Benefits of asyncio Marko Rauhamaa <marko@pacujo.net> - 2014-06-02 23:28 +0300
      Re: Benefits of asyncio Paul Rubin <no.email@nospam.invalid> - 2014-06-02 13:45 -0700
        Re: Benefits of asyncio Chris Angelico <rosuav@gmail.com> - 2014-06-03 07:49 +1000
        Re: Benefits of asyncio Terry Reedy <tjreedy@udel.edu> - 2014-06-02 21:51 -0400
        Re: Benefits of asyncio Marko Rauhamaa <marko@pacujo.net> - 2014-06-03 09:36 +0300
          Re: Benefits of asyncio Chris Angelico <rosuav@gmail.com> - 2014-06-03 18:47 +1000
            Re: Benefits of asyncio Marko Rauhamaa <marko@pacujo.net> - 2014-06-03 12:10 +0300
              Re: Benefits of asyncio Chris Angelico <rosuav@gmail.com> - 2014-06-03 19:30 +1000
                Re: Benefits of asyncio Marko Rauhamaa <marko@pacujo.net> - 2014-06-03 13:08 +0300
                Re: Benefits of asyncio Chris Angelico <rosuav@gmail.com> - 2014-06-03 20:23 +1000
                Re: Benefits of asyncio Marko Rauhamaa <marko@pacujo.net> - 2014-06-03 14:12 +0300
                Re: Benefits of asyncio Paul Rubin <no.email@nospam.invalid> - 2014-06-04 00:52 -0700
              Re: Benefits of asyncio Burak Arslan <burak.arslan@arskom.com.tr> - 2014-06-03 14:05 +0300
              Re: Benefits of asyncio Chris Angelico <rosuav@gmail.com> - 2014-06-03 21:57 +1000
              Re: Benefits of asyncio Burak Arslan <burak.arslan@arskom.com.tr> - 2014-06-04 08:10 +0300
              Re: Benefits of asyncio Chris Angelico <rosuav@gmail.com> - 2014-06-04 17:30 +1000
              Re: Benefits of asyncio Paul Rubin <no.email@nospam.invalid> - 2014-06-04 00:48 -0700
          Re: Benefits of asyncio "Frank Millman" <frank@chagford.com> - 2014-06-03 13:09 +0200
          Re: Benefits of asyncio Chris Angelico <rosuav@gmail.com> - 2014-06-03 22:01 +1000
            Re: Benefits of asyncio Marko Rauhamaa <marko@pacujo.net> - 2014-06-03 16:05 +0300
              Re: Benefits of asyncio Chris Angelico <rosuav@gmail.com> - 2014-06-03 23:31 +1000
                Re: Benefits of asyncio Marko Rauhamaa <marko@pacujo.net> - 2014-06-03 16:42 +0300
                Re: Benefits of asyncio Chris Angelico <rosuav@gmail.com> - 2014-06-03 23:49 +1000
                Re: Benefits of asyncio Marko Rauhamaa <marko@pacujo.net> - 2014-06-03 19:18 +0300
              Re: Benefits of asyncio Roy Smith <roy@panix.com> - 2014-06-03 11:40 -0400
        Re: Benefits of asyncio Paul Sokolovsky <pmiscml@gmail.com> - 2014-06-03 11:31 +0300
  Re: Benefits of asyncio Burak Arslan <burak.arslan@arskom.com.tr> - 2014-06-03 00:07 +0300
  Re: Benefits of asyncio Aseem Bansal <asmbansal2@gmail.com> - 2014-06-02 21:54 -0700

csiph-web