Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C64EF200B14 for ; Sat, 18 Jun 2016 10:09:21 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C4E73160A4E; Sat, 18 Jun 2016 08:09:21 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 190CA160A26 for ; Sat, 18 Jun 2016 10:09:20 +0200 (CEST) Received: (qmail 13990 invoked by uid 500); 18 Jun 2016 08:09:20 -0000 Mailing-List: contact users-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@groovy.apache.org Delivered-To: mailing list users@groovy.apache.org Received: (qmail 13980 invoked by uid 99); 18 Jun 2016 08:09:20 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Jun 2016 08:09:20 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id B8828C0D9E for ; Sat, 18 Jun 2016 08:09:19 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.702 X-Spam-Level: X-Spam-Status: No, score=-0.702 tagged_above=-999 required=6.31 tests=[RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id c1leBA_O8FrZ for ; Sat, 18 Jun 2016 08:09:19 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id 584785F4E4 for ; Sat, 18 Jun 2016 08:09:18 +0000 (UTC) Received: from [192.168.1.4] ([77.176.229.11]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0MN604-1bKo5l288O-006jA7 for ; Sat, 18 Jun 2016 10:09:09 +0200 Subject: Re: GPARS.withPool, xml.MarkupBuilder, XmlParser and HTTPBuilder To: users@groovy.apache.org References: From: Jochen Theodorou Message-ID: <576501A4.7030103@gmx.org> Date: Sat, 18 Jun 2016 10:09:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:18ia21rB2RCq/LEAkBg/aNPCFWjP3oToUlX8E2ciwPeHk1pX1u5 QctAfJjkYcj+si60VafBUgZ+MlQTUDEbphg6soEbCII3pBTbnY10x5PAfKWVT01SWIy+1pM ESW/cpzwoOBfL5u/I3ei0kb5JVhQf1empcA6quMPtnuZjGAAlpF7UoUU97OwtR0IJP32J5H C5c6Zi6svZI9hX6PB4Dng== X-UI-Out-Filterresults: notjunk:1;V01:K0:01VmYbnLPrU=:VDQtxFRBN8fPsCkVkMyyGz K9BFcnFhppgzE+RoYO2AdzjYtYPoygKZUDW3GitRzmwBmA602cfpl83oKwQHGWy85bhc3f5XI Jrv8yTZUriAXezQ2LogYLrf6Pk02GqGT1VjKXP0+VJ7wdo/nLUtG/3YzgNdyJDDVaCM4wKp26 Eev/9z2gWhzJ9UQAm0WqIVX7E6ya3aJ/bQ6o2Djo1rLjDdyxq0fdeu81FC7ZY/VkDU1o+orLF TeJc1a9uez2hR+ZKQyusMRR1sbU+sFYrilBmujpQeNwluHg16CibW3+1n5mRK+PZeIQ4X/C/P B9LvkgLyioctlYYdCeK5v/xdQggKNw2P4iIgM08qr+YNEE3h4pK0LtCCOFR09vDY2DY4Kxbka xBUh/JGMeRnvpfm/NPHgZ5OGHW2LCer3pEoeBYMwlOWkKMRS2dSu/rna9dnqhDl7xbncOKN1O cffhYwI1umeEia1v9xkaY+2FUCCvgT1S7HGICwYRYUpXSTZ2uhoYUn2dl4GeX37rQVek0Gtfx +NU5qU3KjAq73LSm81a9nHB1vd9pIxFnYuATKO1bocI2SgrUeIvgttcHBZnRDwzCiaTLf/f77 Z2H1uNdfmFR8vaIP8+rYXZBvDlNPEX7jCEzUkLFXfkdquaNG78JY4NXof8t7p60u7uw+oaJVy BWOK/wgnnLpMhoXDUbsIJneMVX9OgMZGsHJZXOUTJDf0y4aMpm2OryckNEOrJ8r+DfC2EE8OD /e8+xOQWtiZJ8sez9P30KEcQYPm4vU5gJxrkdbE5rvaIVzOPSrD4KYqqJfd+ALkLCrtGpMyrR vLDDcyh archived-at: Sat, 18 Jun 2016 08:09:22 -0000 On 16.06.2016 09:40, Paolo wrote: [...] > So basically I have a closure called fileworker that will process a file > > def fileworker = { > open file > parse file, adjust some values and create XML file using MarkupBuilder > parse the created XML file using XmlParser > upload file and XML file using HTTPBuilder > } > > and this closure will be used for processing the list in parallel > (collectParallel) > > groovyx.gpars.GParsPool.withPool(threads) { > result = list.collectParallel fileworker > } > > Due to my missing experiences I am a little concerned about thread > safety when GPARS comes into place …. fileworker is self-contained from what I see, so you do not have to worry about concurrency issues in this case. You have to worry about those once you have data shared by multiple threads. bye Jochen