
com.avsystem.commons.rpc.akka.MonixRPCFramework.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commons-akka_2.12.0-RC2 Show documentation
Show all versions of commons-akka_2.12.0-RC2 Show documentation
AVSystem commons library for Scala
The newest version!
package com.avsystem.commons
package rpc.akka
import com.avsystem.commons.rpc.RPCFramework
import monix.reactive.Observable
trait MonixRPCFramework extends RPCFramework {
override type RawRPC <: MonixRawRPC
trait MonixRawRPC {this: RawRPC =>
def observe(rpcName: String, argLists: List[List[RawValue]]): Observable[RawValue]
}
implicit def ObservableRealHandler[A: Writer]: RealInvocationHandler[Observable[A], Observable[RawValue]] =
RealInvocationHandler[Observable[A], Observable[RawValue]](_.map(write[A] _))
implicit def ObservableRawHandler[A: Reader]: RawInvocationHandler[Observable[A]] =
RawInvocationHandler[Observable[A]]((rawRpc, rpcName, argLists) => rawRpc.observe(rpcName, argLists).map(read[A] _))
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy