github AVSystem/scala-commons v1.28.0

latest releases: v2.15.0, v2.14.0, v2.13.3...
5 years ago

Generalized RPC framework - #57

This is an overhaul of RPC macro engine and overall RPC design. Compatibility with previous version is not preserved but RPCFramework is kept as legacy glue code. Porting old usages of RPCFramework to new version should be relatively easy as incompatibilities are not big:

  • Signature of raw methods (fire, call and get) has changed - it takes RPC name in separate parameter list and arguments as List[RawValue] instead of List[List[RawValue]]
  • RPCMetadata API changed - there is separate metadata map for every method type (procedure, function, getter).

Changes in GenCodec and serialization

Breaking changes:

  • HasGenCodec redesigned. MacroCodec[T] removed in favor or MacroGenerated[GenCodec[T]]. HasGenCodec is now more flexible - previously it didn't work for case classes with default parameter values or sealed traits with subclasses in companion object. This was caused by overzealous validation done by the compiler on super constructor arguments - they cannot refer to the object being constructed. Materialization of MacroGenerated is now able to work around this.
  • GenCodec.Auto has been deprecated and will be removed
  • Input and Output now support BigInt and BigDecimal natively - #69

Other changes:

  • @whenAbsent for providing default values for case class parameters used only during deserialization
  • Macro materialization works sealed refined types - #67
  • Macro materialization works for case classes with more than 22 parameters - #62
  • Fixed recursive materialization of flat sealed hierarchies - #63

Don't miss a new scala-commons release

NewReleases is sending notifications on new releases.