Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

GPars has been designed as a concurrency library for the Groovy programming language. This naturally implies GPars is very friendly to Grails and Griffon frameworks and offers applications, which build on top of these frameworks, the ability to:

  • Run expensive computations in the background
  • Parallelize access to remote services or databases and so limit the effect of latency of these services
  • Leverage the high-level concurrency concepts like actors, agents, parallel collections, dataflow and others

To enable GPars in your Grails application, alter the BuildConfig.groovy file as follows:

Code Block
repositories {
    mavenCentral()
    mavenRepo 'http://repository.jboss.org/maven2/'
}
dependencies {
    build 'org.codehaus.gpars:gpars:1.1.0'
}

In Griffon, use the following:

Code Block
griffon.project.dependency.resolution = {
    inherits "global"

    default dependencies
        repositories {
            griffonHome()
            mavenCentral()
        }
        dependencies {
            runtime org.codehaus.gpars:gpars:1.1.0
        }
    }
}

Once the dependency has been specified, you can start using GPars in your project. You may now want to check out the Groovy Fast Track to do your first GPars experiments. Alternatively go directly to the User Guide and have fun!