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


Groups > comp.lang.python > #102695

Asyncio thought experiment

Path csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Marko Rauhamaa <marko@pacujo.net>
Newsgroups comp.lang.python
Subject Asyncio thought experiment
Date Tue, 09 Feb 2016 00:13:11 +0200
Organization A noiseless patient Spider
Lines 20
Message-ID <87oabqq2a0.fsf@elektro.pacujo.net> (permalink)
Mime-Version 1.0
Content-Type text/plain
Injection-Info mx02.eternal-september.org; posting-host="b7cb1518d23ec19d482dcc9c31d30fdd"; logging-data="7282"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19AZF7rdbLpAdJHptxvb2O0"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Cancel-Lock sha1:cMwg/QOOgnEjRPHf3FM+M4K6hsg= sha1:eblwOwI1cbvzaLsXFpwpZOTkPU4=
Xref csiph.com comp.lang.python:102695

Show key headers only | View raw


As I stated in an earlier post, a normal subroutine may turn out to be
blocking. To make it well-behaved under asyncio, you then dutifully tag
the subroutine with "async" and adorn the blocking statement with
"await". Consequently, you put "await" in front of all calls to the
subroutine and cascade the "async"s and "await"s all the way to the top
level.

Now what would prevent you from making *every* function an "async" and
"await"ing *every* function call? Then, you would never fall victim to
the cascading async/await.

And if you did that, why bother sprinkling async's and await's
everywhere? Why not make every single function call an await implicitly
and every single subroutine an async? In fact, that's how everything
works in multithreading: blocking statements don't need to be ornamented
in any manner.


Marko

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


Thread

Asyncio thought experiment Marko Rauhamaa <marko@pacujo.net> - 2016-02-09 00:13 +0200
  Re: Asyncio thought experiment "Sven R. Kunze" <srkunze@mail.de> - 2016-02-10 18:44 +0100

csiph-web