When developing both the frontend and backend in Kotlin it's just weird that we have to bother with rest json apis to connect them. Ideal would be the ability to define an interface
interface Api {
fun sum(x: Int, y: Int): Int
}
Implement it on the server side.
And on the client side be able to call it as easy as
val api = RPCMagic<Api>
val result: Future<Int> = api.sum(2, 2)
Much like scala autowire library does.
Remote Procedure Call is a software communication protocol that one program can use to request a service from a program located in another computer on a network without having to understand the network's details. RPC is used to call other processes on the remote systems like a local system.
The basic steps involved, for most RPC implementations, are as follows. Write the package definition file to define the software interface. Run the RPC compiler to produce the stub code. Link together the client modules (program, stub, RTS) to make the client module.
Other examples of the use of RPC in experiments at CERN include: remote monitoring program control, remote FASTBUS access, remote error logging, remote terminal interaction with processors in VMEbus, the submission of operating system commands from embedded microprocessors, and many less general functions.
The Remote Procedure Call (RPC) message protocol consists of two distinct structures: the call message and the reply message (see RPC Call Message and RPC Reply Message). A client makes a remote procedure call to a network server and receives a reply containing the results of the procedure's execution.
At this time Kotlin provides no functionality for this, but it's on our medium-term roadmap (after 1.2).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With