abstract class RPCCompanion[RealRPC] extends AnyRef

Convenience abstract class for companion objects of RPC interfaces. Makes sure all three RPC type classes (AsRawRPC, AsRealRPC and RPCMetadata) are macro-materialized for that RPC interface and confines macro materialization to the same compilation unit where the RPC interface is defined. This is a good practice to avoid incremental compilation problems and duplication of macro-generated code in various callsites. In order to be able to use RPCCompanion, the RPC framework must define FullRPCInfo as a trait or class. Additionally, some special wizardry has been employed to make sure that when an RPC interface is a part of shared (cross-compiled) code of a ScalaJS application then ScalaJS optimizer can remove unused instances of macro generated typeclasses.

Example:
  1. object SomeRPCFramework extends StandardRPCFramework { ... }
    @RPC trait SomeRPC {
      def doSomething(str: String): Unit
      def callSomething(int: Int): Future[String]
    }
    object SomeRPC extends SomeRPCFramework.RPCCompanion[SomeRPC]
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RPCCompanion
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RPCCompanion()(implicit fri: FullRPCInfo[RealRPC])

Value Members

  1. implicit macro def asRawRPC: AsRawRPC[RealRPC]
  2. implicit macro def asRealRPC: AsRealRPC[RealRPC]
  3. final def fullRpcInfo: FullRPCInfo[RealRPC]
  4. implicit macro def metadata: RPCMetadata[RealRPC]