Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonatasemidio/a68a829ce7c8c11bbf56 to your computer and use it in GitHub Desktop.
Save jonatasemidio/a68a829ce7c8c11bbf56 to your computer and use it in GitHub Desktop.
Find in all selected pages the described expression in parallel
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