Problem with grails 2.3 async features #6

Open
tamershahin opened this Issue Jan 23, 2014 · 0 comments

Comments

Projects
None yet
1 participant
Contributor

tamershahin commented Jan 23, 2014

I'm using this plugin and everthing works fine, but when I try to return an async promise i always get an error. Seems that the plugin is not aware that grails now rely on servlet 3.0 features to handle promises as return value of an action.
this is my code:

def index(String ticker) {

    def t = task {
        sleep(5000)
        int r = Random.newInstance().nextInt()
        println "task ${r}"
        render "task ${r}"
        return "task ${r} finished"
    }
    .onComplete { result ->
        println 'onComplete : ' + result
    }
    .onError { error ->
        error.toString()
    }
    println 'action finished'
    return t
}

this is the stacktrace:

action finished
task 262404793
onComplete : task 262404793 finished
| Error 2014-01-23 16:33:57,523 [Actor Thread 8] ERROR gpars.LoggingPoolFactory - Async execution error: null
Message: null
Line | Method
->> 61 | doCall in org.grails.async.factory.gpars.GparsPromise$_onComplete_closure1


| 62 | run in groovyx.gpars.dataflow.DataCallback$1
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 724 | run . . . in java.lang.Thread
| Error 2014-01-23 16:33:57,523 [Actor Thread 5] ERROR gpars.LoggingPoolFactory - Async execution error: null
Message: null
Line | Method
->> 61 | doCall in org.grails.async.factory.gpars.GparsPromise$_onComplete_closure1


| 62 | run in groovyx.gpars.dataflow.DataCallback$1
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 724 | run . . . in java.lang.Thread

Am i doing something wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment