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


Groups > comp.lang.python > #105703

Re: Adding run_in_executor task to already existing loop.

From Zachary Ware <zachary.ware+pylist@gmail.com>
Newsgroups comp.lang.python
Subject Re: Adding run_in_executor task to already existing loop.
Date 2016-03-25 16:00 -0500
Message-ID <mailman.9.1458939670.28225.python-list@python.org> (permalink)
References <mailman.7.1458937485.28225.python-list@python.org> <87mvpm1dlo.fsf@elektro.pacujo.net>

Show all headers | View raw


On Fri, Mar 25, 2016 at 3:56 PM, Marko Rauhamaa <marko@pacujo.net> wrote:
> Ray Cote <rgacote@appropriatesolutions.com>:
>
>> I’m trying to perform an synchronous task while using asyncio.
>
> You seem to want to do something you shouldn't be doing. Asyncio does
> not tolerate synchronous/blocking calls. You will need to move those in
> separate threads or processes if you can't turn them into asynchronous
> tasks.

That's exactly what run_in_executor does.

-- 
Zach

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


Thread

Adding run_in_executor task to already existing loop. Ray Cote <rgacote@appropriatesolutions.com> - 2016-03-25 16:24 -0400
  Re: Adding run_in_executor task to already existing loop. Marko Rauhamaa <marko@pacujo.net> - 2016-03-25 22:56 +0200
    Re: Adding run_in_executor task to already existing loop. Zachary Ware <zachary.ware+pylist@gmail.com> - 2016-03-25 16:00 -0500

csiph-web