Need help with zio-grpc?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

scalapb
179 Stars 44 Forks Apache License 2.0 442 Commits 22 Opened issues

Description

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

Services available

!
?

Need anything else?

Contributors list

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.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.