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


Groups > comp.lang.python > #75154

Re: Question about asyncio doc example

From Marko Rauhamaa <marko@pacujo.net>
Newsgroups comp.lang.python
Subject Re: Question about asyncio doc example
Date 2014-07-24 20:07 +0300
Organization A noiseless patient Spider
Message-ID <87mwbysn29.fsf@elektro.pacujo.net> (permalink)
References (1 earlier) <lqpjnu$dun$1@ger.gmane.org> <CAO3PiBgduzC32zEvq=v+CjiWecguFuD5VyZWZCXL5PEGCnE-Xg@mail.gmail.com> <mailman.12268.1406185154.18130.python-list@python.org> <87d2cvmd8u.fsf@elektro.pacujo.net> <mailman.12280.1406220421.18130.python-list@python.org>

Show all headers | View raw


Ian Kelly <ian.g.kelly@gmail.com>:

> Callbacks can easily schedule coroutines, but they can't wait on them,
> because that would require suspending their execution, dropping back
> to the event loop, and resuming later -- in other words, the callback
> would need to be a coroutine also.

I guess the key is, can a callback release a lock or semaphore, notify a
condition variable, or put an item into a queue that a coroutine is
waiting on?

Quite possibly. Didn't try it. In that case, callbacks mix just fine
with coroutines.


Marko

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


Thread

Re: Question about asyncio doc example Terry Reedy <tjreedy@udel.edu> - 2014-07-24 02:58 -0400
  Re: Question about asyncio doc example Marko Rauhamaa <marko@pacujo.net> - 2014-07-24 10:23 +0300
    Re: Question about asyncio doc example Ian Kelly <ian.g.kelly@gmail.com> - 2014-07-24 10:46 -0600
      Re: Question about asyncio doc example Marko Rauhamaa <marko@pacujo.net> - 2014-07-24 20:07 +0300

csiph-web