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.

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Zachary Ware <zachary.ware+pylist@gmail.com>
Newsgroups comp.lang.python
Subject Re: Adding run_in_executor task to already existing loop.
Date Fri, 25 Mar 2016 16:00:48 -0500
Lines 14
Sender zachary.ware@gmail.com
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>
Reply-To python-list@python.org
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
X-Trace news.uni-berlin.de +188WbjTW2vsH6oOEdzFwA2Y5va03fffwn4+pSL6zorg==
Return-Path <zachary.ware@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.028
X-Spam-Evidence '*H*': 0.94; '*S*': 0.00; 'calls.': 0.07; 'received:209.85.218': 0.10; '2016': 0.16; 'i\xe2\x80\x99m': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:Adding': 0.16; 'subject:already': 0.16; 'threads': 0.16; 'wrote:': 0.16; 'sender:addr:gmail.com': 0.18; "shouldn't": 0.18; 'to:name:python- list@python.org': 0.20; 'trying': 0.22; 'header:In-Reply-To:1': 0.24; 'fri,': 0.27; 'separate': 0.27; 'message- id:@mail.gmail.com': 0.27; 'ray': 0.29; 'task': 0.30; "can't": 0.32; 'received:google.com': 0.35; 'something': 0.35; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'turn': 0.37; 'seem': 0.37; 'received:209': 0.38; 'does': 0.39; 'to:addr:python.org': 0.40; 'mar': 0.65; 'tasks.': 0.66; 'header:Reply-To:1': 0.67; 'reply-to:no real name:2**0': 0.71; 'reply-to:addr:python.org': 0.84; 'tolerate': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=dElORqTyxrqZoyV8XQ/ng4KNLfSAL+F4kifUQBUPUDA=; b=S7jAKU9amhIDo+dt9HQAOwu3vLN2s6wwm4XdxtMJ1B7SrkYKisV2ryru0q6ZHg13pj JYSLYW85etsNUB/RAjJeeTDvDrvZoP/+8SdGRb5p7HL9odVnnswQicaLllcRkh84vL80 jPr7/sSe85fGn0jXP3PTq7VCKQgq0KRiGBPCLBt2ZjZJdcp/0+DxP4Gei3BFtYC9nlzZ 7FMvrtXsUsRqzeJ8bh8p0lIewtMziGLRkSIprAIeBQQiGKNwWc19frv1fZf/xlNt84ye F7EFgbe25Se6uX+pBrKFEtNSL7DwmW5/SJBoi4Px0ceWg2j/epGCXMdDMR63fbuz9v/K VjUw==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:sender:in-reply-to :references:from:date:message-id:subject:to :content-transfer-encoding; bh=dElORqTyxrqZoyV8XQ/ng4KNLfSAL+F4kifUQBUPUDA=; b=gIoCr2vt43OMNcuF6qLLJJH/h9H50r4yfPfsrl8I6+C7P9FNOi6XEmYzBVIpypISxo JxePmpY5o5t4q40syDdm7Lp7O1Eavb6/JZMoGO5SBenfLTNeMExF4tEjBoIAMau7hmqy qlIYER7rX+hn8qP4miHh37PgbgstgQTeWOltqyPl5BHcMrIpkwrlXDbOfQl3ScSjpzbw GzFOnFV6OlmGvATZ4rjccjmKekX13Mvb5nPRcHuUAXAcmA5zOMSvCn39WkCwfn5pmt3K vwE4R7YrZsrZCN7h8nAHCPDbihj4SdjtLs/PKVkzoJuUDnBX+mEAgHPiZhxfeNOGRhqJ wowg==
X-Gm-Message-State AD7BkJKODCI+w8fLKcXCXCEAv9krZGNHhqEft/LT5AfkON2mwrsmArNjDtgOC+dSDAsnpT0sAWIwzeMxkGqpzg==
X-Received by 10.202.86.198 with SMTP id k189mr7383671oib.105.1458939667416; Fri, 25 Mar 2016 14:01:07 -0700 (PDT)
In-Reply-To <87mvpm1dlo.fsf@elektro.pacujo.net>
X-Google-Sender-Auth RiwnLzIcVmzk_ey-gC8PpNPwcD0
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.21
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>
Xref csiph.com comp.lang.python:105703

Show key headers only | 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