Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.036 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'slow.': 0.09; 'subject:question': 0.10; 'api': 0.11; 'coroutines': 0.16; 'dump': 0.16; 'received:172.18.0': 0.16; 'thanks,': 0.17; 'memory': 0.22; 'example': 0.22; 'portion': 0.22; 'header:Received:8': 0.24; 'performing': 0.26; 'second': 0.26; 'fixed': 0.29; 'external': 0.29; 'code': 0.31; 'fine,': 0.31; 'anyone': 0.31; 'worked': 0.33; 'third': 0.33; 'something': 0.35; 'objects': 0.35; 'but': 0.35; 'there': 0.35; 'done': 0.36; 'charset:us-ascii': 0.36; 'two': 0.37; 'to:addr:python-list': 0.38; 'ability': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'up,': 0.60; 'received:unknown': 0.61; 'took': 0.61; 'first': 0.61 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=dwjLhcNAn+N65iW9oApC92yF2BXVJAhWBlCn9pRWT9g= c=1 sm=1 a=7PYXob_7ZXMA:10 a=P90J6pEA2ccA:10 a=BLceEmwcHowA:10 a=kj9zAlcOel0A:10 a=xqWC_Br6kY4A:10 a=oNw28mxuUhXRB3mVwYQ4Ag==:17 a=Ar_50zpjHgq-l5lUCdkA:9 a=CjuIK1q_8ugA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=activenetwerx.com; s=default; t=1394745869; bh=AW2kvYMfmqYk56BE46RRqNABepXbET26hmxZbIu2Qmk=; h=From:To:Subject:Date; b=0KnwaqmWVYq2APBUqFn91AxOR55xUMR8Fv7XNHUchaRkpxOlWbdqVxODUbwyrfJMh 2/3SnhY/Z6xck2lnMcDfXKz421cgN4YD6u/fG5uuylXFm2adqaymd99ya6Nj3tmQMO WufoulTR+zETQsZv1VOJ2f/kSX+3tYp96hlOSDVA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=activenetwerx.com; s=default; t=1394745869; bh=AW2kvYMfmqYk56BE46RRqNABepXbET26hmxZbIu2Qmk=; h=From:To:Subject:Date; b=0KnwaqmWVYq2APBUqFn91AxOR55xUMR8Fv7XNHUchaRkpxOlWbdqVxODUbwyrfJMh 2/3SnhY/Z6xck2lnMcDfXKz421cgN4YD6u/fG5uuylXFm2adqaymd99ya6Nj3tmQMO WufoulTR+zETQsZv1VOJ2f/kSX+3tYp96hlOSDVA= X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.activenetwerx.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=ham version=3.3.1 From: "Joseph L. Casale" To: Python Subject: asyncio question Thread-Topic: asyncio question Thread-Index: AQHPPwHVQBlJkxkAC0C+DZrDt1zLpA== Date: Thu, 13 Mar 2014 21:24:15 +0000 Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.18.0.4] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1394745940 news.xs4all.nl 2927 [2001:888:2000:d::a6]:58788 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:68340 I have a portion of code I need to speed up, there are 3 api calls to an ex= ternal system=0A= where the first enumerates a large collection of objects I then loop throug= h and perform=0A= two additional api calls each. The first call is instant, the second and th= ird per object are=0A= very slow. Currently after accumulating all the data I write the relevant d= ata into a database.=0A= =0A= I have the ability to hold all this in memory and dump it once fully accumu= lated, so performing=0A= the second and third call in parallel with fixed batches would be great,=0A= =0A= I took a look at coroutines and some skeleton code worked fine, but I am no= t sure how to=0A= perform the acquisition in fixed groups like I might for example with multi= processing and=0A= a pool of workers.=0A= =0A= Anyone done something like this or have an opinion?=0A= =0A= Thanks,=0A= jlc=