Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Zachary Ware 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: References: <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: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:105703 On Fri, Mar 25, 2016 at 3:56 PM, Marko Rauhamaa wrote: > Ray Cote : > >> I=E2=80=99m 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. --=20 Zach