Running async method in groovy

4.5k views Asked by At

In Grails service, I would like to render a page while another method is running asynchronously. I tried different things from the documentation async and gpars library. None of the listed things worked as desired.

GParsPool.withPool(2) {
    this.&longFunction.callAsync(command)
    rendering()
}

later tried

    GParsPool.withPool(2) {
        def a ={longFunction(command)}.async()
        a()
        rendering()
    }
0

There are 0 answers