Created
November 27, 2013 13:40
-
-
Save newgeekorder/7675835 to your computer and use it in GitHub Desktop.
parallel http calls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static groovyx.gpars.GParsExecutorsPool.withPool | |
def restUrl = ["http://url1", "http://url2", "http://url3"] | |
def poolSize =restUrl.length | |
withPool(poolSize) { | |
poolSize.times { | |
Closure callUrl = {"http://google.com".toURL().withReader {}} | |
callUrl.callAsync(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment