Skip to content
forked from scalapb/zio-grpc

ScalaPB meets ZIO: write purely functional gRPC services and clients using ZIO

License

Notifications You must be signed in to change notification settings

oridag/zio-grpc

 
 

Repository files navigation

ZIO gRPC Logo

Snapshot Artifacts

Welcome to ZIO-gRPC

This library enables you to write purely functional gRPC services using ZIO.

Documentation

Highlights

  • Supports all types of RPCs (unary, client streaming, server streaming, bidirectional).
  • Uses ZIO's Stream to let you easily implement streaming requests.
  • Cancellable RPCs: client-side ZIO interruptions are propagated to the server to abort the request and save resources.

Installation

Find the latest snapshot in here.

Add the following to your project/plugins.sbt:

val zioGrpcVersion = "0.4.2"

addSbtPlugin("com.thesamet" % "sbt-protoc" % "1.0.0-RC4")

libraryDependencies += "com.thesamet.scalapb.zio-grpc" %% "zio-grpc-codegen" % zioGrpcVersion

Add the following to your build.sbt:

val grpcVersion = "1.34.0"

PB.targets in Compile := Seq(
    scalapb.gen(grpc = true) -> (sourceManaged in Compile).value,
    scalapb.zio_grpc.ZioCodeGenerator -> (sourceManaged in Compile).value,
)

libraryDependencies ++= Seq(
    "com.thesamet.scalapb" %% "scalapb-runtime-grpc" % scalapb.compiler.Version.scalapbVersion,
    "io.grpc" % "grpc-netty" % grpcVersion
)

Usage

Place your service proto files in src/main/protobuf, and the plugin will generate Scala sources for them. Learn more about how to use ZIO gRPC generated code.

See a full example at the examples directory.

About

ScalaPB meets ZIO: write purely functional gRPC services and clients using ZIO

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Scala 92.0%
  • JavaScript 6.1%
  • CSS 1.6%
  • Nix 0.3%