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


Groups > comp.lang.python > #68236

Re: which async framework?

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'read.': 0.03; '(at': 0.04; 'guido': 0.05; 'must.': 0.07; 'protocols,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'separately': 0.09; 'api': 0.11; 'python': 0.11; 'jan': 0.12; 'suggest': 0.14; 'thread': 0.14; '(do': 0.16; 'blocking': 0.16; 'candidates.': 0.16; 'expecting': 0.16; "guido's": 0.16; 'non-blocking': 0.16; 'opposite': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'simpler,': 0.16; 'subject:which': 0.16; 'twisted': 0.16; 'wsgi': 0.16; ':-)': 0.16; 'fix': 0.17; 'wrote:': 0.18; 'code.': 0.18; 'app': 0.19; 'trying': 0.19; 'possible,': 0.19; '>>>': 0.22; 'code,': 0.22; 'putting': 0.22; 'header:User-Agent:1': 0.23; 'oriented': 0.24; 'decide': 0.24; 'post': 0.26; 'least': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'record': 0.27; 'idea': 0.28; 'rest': 0.29; 'chris': 0.29; 'am,': 0.29; 'database,': 0.30; "i'm": 0.30; 'code': 0.31; 'easier': 0.31; 'posting': 0.31; 'requests': 0.31; 'serve': 0.31; 'doc': 0.31; 'layer': 0.31; 'protocols': 0.31; 'interface': 0.32; 'option': 0.32; 'community': 0.33; 'guess': 0.33; 'not.': 0.33; "i'd": 0.34; 'could': 0.34; 'knowledge': 0.35; 'but': 0.35; 'there': 0.35; 'really': 0.36; 'are,': 0.36; 'interface,': 0.36; "i'll": 0.36; 'subject:?': 0.36; 'similar': 0.36; 'should': 0.36; 'too': 0.37; 'confirmed': 0.38; 'to:addr:python-list': 0.38; 'recent': 0.39; 'expect': 0.39; 'does': 0.39; 'bad': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'mailing': 0.39; 'received:org': 0.40; 'called': 0.40; 'how': 0.40; 'read': 0.60; 'most': 0.60; 'hope': 0.61; 'ago.': 0.61; 'received:173': 0.61; 'personal': 0.63; 'our': 0.64; 'networking': 0.64; 'pick': 0.64; 'more': 0.64; 'between': 0.67; 'jobs': 0.68; 'response.': 0.68; 'hour': 0.70; 'hand': 0.80; 'flame': 0.84; 'received:fios.verizon.net': 0.84; 'faced': 0.91; 'why?': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: which async framework?
Date Tue, 11 Mar 2014 15:41:30 -0400
References <531E22DF.7030709@simplistix.co.uk> <lflcha$2mf$1@ger.gmane.org> <531EC0E6.10402@simplistix.co.uk>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host pool-173-75-254-207.phlapa.fios.verizon.net
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0
In-Reply-To <531EC0E6.10402@simplistix.co.uk>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.8059.1394566924.18130.python-list@python.org> (permalink)
Lines 64
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1394566924 news.xs4all.nl 2848 [2001:888:2000:d::a6]:35821
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:68236

Show key headers only | View raw


On 3/11/2014 3:53 AM, Chris Withers wrote:
> On 10/03/2014 21:57, Terry Reedy wrote:
>>> I'd like to be able to serve the rest of the web api using a pyramid
>>> wsgi app if possible, and I'd like to be able to write the things that
>>> process requests in and validation out in a synchronous fashion, most
>>> likely spinning off a thread for each one.
>>
>> If you are writing 'standard' blocking, synchronous code, I am not sure
>> why you would use any of the above.
>
> The idea I have is to do all the networking async based on a declarative
> set of messages in and recording all messages out and then hand that set
> of messages off to a syncronous layer to make assertions, record into a
> database, etc.

In the absence of an event-loop oriented queue, putting jobs on a thread 
queue for a job-handler makes sense.

>>> The protocols are all financial (do we really not have a pure-python FIX
>>> library?!) but none are likely to have existing python implementations.
>>>
>>> How should I pick between the options? What would people recommend and
>>> why?
>>
>> I know nothing of tornado. I personally would use asyncio over twisted
>> if I could because it is simpler, in the stdlib, has the option to write
>> 'untwisted' non-blocking code similar to blocking code, and the docs
>> easier for me to read.

> Guess I was expecting more of a response.

Let me try again. I read the Twisted docs a couple of years ago.  While 
I could deal with the interface, I understand why it is called 'twisted' 
and why Guido does not particularly like it. I read the asyncio doc 
before the most recent revisions and found it easier to understand. I 
personally like the co-routine layer.  But I know that this is very much 
a personal preference.  (Sturla just confirmed this by posting the 
opposite response to the coroutine interface.) So I suggest you spend an 
hour with the doc for each of the three candidates.

> I suspect I'll just end up cross-posting to the various mailing lists,

Bad idea. Post separately if you must.

 > which I hope won't cause too much offence or kick off any flame wars.

It would do both.

> I'm faced with a difficult choice that I suspect many in our community
> are, just trying to find out how to make the best decision :-)

The asyncio event loop interface was designed with knowledge of other 
event loops, including but not limited to those of twisted and tornado. 
The implementation in asyncio is intended to be replaceable by other 
implementations that include the same interface. I do not know if there 
are adapters yet for the twisted and tornado loops, but I expect there 
will be, official or not. Part of Guido's intent is to reduce 
single-framework lockin. If you start with asyncio, and decide you want 
to use some Twisted protocols, you should be able to (at least in the 
future) without dumping your current code.

-- 
Terry Jan Reedy

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


Thread

Re: which async framework? Terry Reedy <tjreedy@udel.edu> - 2014-03-11 15:41 -0400

csiph-web