How to make a remote remote call (RPC) call in Kotlin?

When developing frontend and backend in Kotlin it is just weird that we have to worry about json apis will support them. The ideal would be to define an interface

interface Api {
    fun sum(x: Int, y: Int): Int
}

      

Implement it server side.

And on the client side one can call it as simple as

val api = RPCMagic<Api>
val result: Future<Int> = api.sum(2, 2)

      

Like scala autowire library .

+3


source to share


1 answer


At this time, Kotlin does not provide any functionality to do this, but it is on our mid-term roadmap (after 1.2).



+3


source







All Articles