All Downloads are FREE. Search and download functionalities are using the official Maven repository.

endless.protobuf.ProtobufOutgoingCommand.scala Maven / Gradle / Ivy

There is a newer version: 0.31.0
Show newest version
package endless.protobuf
import endless.core.protocol.{Decoder, OutgoingCommand}
import scalapb.{GeneratedMessage, GeneratedMessageCompanion}

class ProtobufOutgoingCommand[
    C <: GeneratedMessage: GeneratedMessageCompanion,
    R <: GeneratedMessage: GeneratedMessageCompanion,
    A
](command: C, replyMapper: R => A)
    extends OutgoingCommand[A] {
  override def payload: Array[Byte] = ProtobufEncoder[C].encode(command)
  override def replyDecoder: Decoder[A] = ProtobufDecoder[R].map(replyMapper)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy