Created
July 9, 2014 17:54
-
-
Save jonatasemidio/a68a829ce7c8c11bbf56 to your computer and use it in GitHub Desktop.
Find in all selected pages the described expression in parallel
This file contains 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.GParsPool.withPool | |
def urls = [ | |
'http://groovy.codehaus.org', | |
'http://gpars.codehaus.org', | |
'http://gr8conf.org/' | |
]*.toURL() | |
println withPool { | |
urls.collectParallel { | |
it.text.findAll(~/[Gg]roovy/).size() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment