diff --git a/README.md b/README.md index 90afedee..48af42f6 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,18 @@ back-pressure model. Reactive gRPC supports the following reactive programming models: -* [RxJava 2](https://github.com/ReactiveX/RxJava) -* [Spring Reactor](https://projectreactor.io/) +* [RxJava 2](https://github.com/salesforce/reactive-grpc/tree/master/rx-java) +* [Spring Reactor](https://github.com/salesforce/reactive-grpc/tree/master/reactor) * (Eventually) [Java9 Flow](https://community.oracle.com/docs/DOC-1006738) # Usage See the readme in each technology-specific sub-directory for usage details. +# Demos + +* [RxChat](https://github.com/salesforce/reactive-grpc/tree/master/demos/RxChat) - An IRC-like chat system built using RxJava and RxGrpc. +* [ReactorChat](https://github.com/salesforce/reactive-grpc/tree/master/demos/ReactorChat) - An IRC-like chat system using Spring Reactor and ReactorGrpc. + # Back-pressure Reactive gRPC stubs support bi-directional streaming with back-pressure. Under the hood, Reactive gRPC is built atop the vanilla gRPC service stubs generated by protoc. As such, they inherit gRPC's HTTP/2-based back-pressure model. diff --git a/reactor/README.md b/reactor/README.md index 305a6140..15b4e3f8 100644 --- a/reactor/README.md +++ b/reactor/README.md @@ -2,8 +2,9 @@ Overview ======== Reactor-gRPC is a set of gRPC bindings for reactive programming with [Reactor](http://projectreactor.io/). -Usage +Installation ===== +### Maven To use Reactor-gRPC with the `protobuf-maven-plugin`, add a [custom protoc plugin configuration section](https://www.xolstice.org/protobuf-maven-plugin/examples/protoc-plugin.html). ```xml @@ -17,6 +18,34 @@ To use Reactor-gRPC with the `protobuf-maven-plugin`, add a [custom protoc plugi ``` +### Gradle +To use RxGrpc with the `protobuf-gradle-plugin`, add a RxGrpc to the protobuf `plugins` section. +```scala +protobuf { + protoc { + // The artifact spec for the Protobuf Compiler + artifact = "com.google.protobuf:protoc:${protobufVersion}" + } + plugins { + grpc { + artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" + } + reactor { + artifact = "com.salesforce.servicelibs:reactor-grpc:${reactiveGrpcVersion}:jdk8@jar" + } + } + generateProtoTasks { + ofSourceSet("main")*.plugins { + grpc { } + reactor {} + } + } +} +``` +*At this time, RxGrpc with Gradle only supports bash-based environments. Windows users will need to build using Windows Subsystem for Linux (win 10), Gitbash, or Cygwin.* + +Usage +===== After installing the plugin, Reactor-gRPC service stubs will be generated along with your gRPC service stubs. * To implement a service using an Reactor-gRPC service, subclass `Reactor[Name]Grpc.[Name]ImplBase` and override the Reactor-based diff --git a/rx-java/README.md b/rx-java/README.md index 65683afd..d79a8da7 100644 --- a/rx-java/README.md +++ b/rx-java/README.md @@ -2,8 +2,9 @@ Overview ======== RxGrpc is a new set of gRPC bindings for reactive programming with [RxJava](https://github.com/ReactiveX/RxJava). -Usage -===== +Installation +============ +### Maven To use RxGrpc with the `protobuf-maven-plugin`, add a [custom protoc plugin configuration section](https://www.xolstice.org/protobuf-maven-plugin/examples/protoc-plugin.html). ```xml @@ -16,7 +17,34 @@ To use RxGrpc with the `protobuf-maven-plugin`, add a [custom protoc plugin conf ``` +### Gradle +To use RxGrpc with the `protobuf-gradle-plugin`, add a RxGrpc to the protobuf `plugins` section. +```scala +protobuf { + protoc { + // The artifact spec for the Protobuf Compiler + artifact = "com.google.protobuf:protoc:${protobufVersion}" + } + plugins { + grpc { + artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" + } + rxgrpc { + artifact = "com.salesforce.servicelibs:rxgrpc:${reactiveGrpcVersion}:jdk8@jar" + } + } + generateProtoTasks { + ofSourceSet("main")*.plugins { + grpc { } + rxgrpc {} + } + } +} +``` +*At this time, RxGrpc with Gradle only supports bash-based environments. Windows users will need to build using Windows Subsystem for Linux (win 10), Gitbash, or Cygwin.* +Usage +===== After installing the plugin, RxGrpc service stubs will be generated along with your gRPC service stubs. * To implement a service using an RxGrpc service, subclass `Rx[Name]Grpc.[Name]ImplBase` and override the RxJava-based