Autowire- RPC 远程过程调用

网友投稿 770 2022-11-02

Autowire- RPC 远程过程调用

Autowire- RPC 远程过程调用

Autowire 包含一对宏,可以让你在两个 Scala 系统之间执行类型安全、无反射的 RPC 远程过程调用。示例代码

// shared interfacetrait Api{  def add(x: Int, y: Int, z: Int): Int }// server-side router and implementation object Server extends autowire.Server...object ApiImpl extends Api  def add(x: Int, y: Int, z: Int) = x + y + z }// client-side callsiteobject Client extends autowire.Client...Client[Api].add(1, 2, 3).call(): Future[Int]//         |    |             |//         |    |             The T is pickled and wrapped in a Future[T]//         |    The arguments to that method are pickled automatically//         Call a method on the `Api` trait

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:使用JSONObject生成和解析json
下一篇:一组Web组件可将您的Web应用程序变成一个虚拟的操作系统
相关文章

 发表评论

暂时没有评论,来抢沙发吧~