Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kotlin and AsyncResult #32

Open
mdtrooper opened this issue Jun 7, 2021 · 0 comments
Open

Kotlin and AsyncResult #32

mdtrooper opened this issue Jun 7, 2021 · 0 comments

Comments

@mdtrooper
Copy link

I am trying to code the example in language Kotlin:

/*
 * This Kotlin source file was generated by the Gradle 'init' task.
 */
package poc_kotlin_celery

import com.geneea.celery.*

fun main() {
   val client: Celery = Celery.builder()
        .brokerUri("amqp://localhost/%2F")
        .backendUri("rpc://localhost/%2F")
        .build();

   val args = arrayOf(1, 2)

   println("${client::class.simpleName}")
   println("${client::class.qualifiedName}")

   val result: Any = client.submit("task.add", args)
//   println("${result::class.simpleName}")

//   val suma: Int = result.get()

//>   println(suma)
}

But I have this error when I try to run:

$ gradle run

> Task :app:compileKotlin FAILED
e: /home/miguel/code/poc_kotlin_celery/app/src/main/kotlin/poc_kotlin_celery/App.kt: (19, 29): Not enough information to infer type variable R

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileKotlin'.
> Compilation error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 758ms
1 actionable task: 1 executed

I think that it may be the type of result, but I was trying with AsyncResult<Int> and it failed too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant