Kotlin Actors
mpfau opened this issue · 5 comments
I saw that you played around with kotlin in an example. This made me interested, too and I tried to use kontraktor with kotlin. Unfortunately, sth. seems wrong with kotlin actors...
I used the same (kotlin) client for two two examples where the server (actor) part has been implemented once in Java and once in Kotlin:
- Unfortunately, the kotlin actor was executed in the client scope.
- The Actor implemented was executed in the server scope as expected.
I launched separate VMs for client and server in both cases.
oops, will investigate as i find time .. busy currently. actually the kotlin stuff was just some playground ..
you are right, seems like kotlin clashes with the runtime bytecode generation done by kontraktor. Same example works with java implementation ..
only tell/aks semantics schedule properly
client.ask("xy", 17 ).then { x,y -> println("remote result $x" ) } // works
client.xy( 17 ).then { x,y -> println("remote result $x" ) } // does not work !!!!!
I found the issue: by default all kotlin methods are final, so the generated overridden methods did not get called. changing remoteable methods to "open" fixed it. Still somewhat whacky ..
see updated example