Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the Readme to show how to configure the generator #15

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
# Welcome to monix-grpc

This library enables you to write grpc services with Monix based on ScalaPB.
This library allows you to generate [Monix](https://zio.dev) stubs and servers of [gRPC](https://grpc.io/)

## Highlights

* Supports all types of RPCs (unary, client streaming, server streaming, bidirectional).
* Uses Monix's `Observable` to let you easily implement streaming requests.
* Cancellable RPCs: client-side Monix cancellations are propagated to the server to abort the request and save resources.

## Installation

Find the latest snapshot in [here](https://oss.sonatype.org/content/repositories/snapshots/com/thesamet/scalapb/zio-grpc/zio-grpc-core_2.13/).

Add the following to your `project/plugins.sbt`:

val MonixGrpcVersion = "0.0.1"

addSbtPlugin("com.thesamet" % "sbt-protoc" % "1.0.4")

libraryDependencies += "me.vican.jorge" %% "monix-grpc-codegen" % MonixGrpcVersion

Add the following to your `build.sbt`:

val grpcVersion = "1.36.0"

PB.targets in Compile := Seq(
scalapb.gen(grpc = false) -> (sourceManaged in Compile).value,
monix.grpc.codegen.GrpcCodeGenerator -> (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.