Skip to content

Commit

Permalink
Merge pull request #24 from salesforce/feature/docs
Browse files Browse the repository at this point in the history
Feature/docs
  • Loading branch information
rmichela authored Nov 30, 2017
2 parents 7932202 + c487747 commit ee72a76
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 5 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
31 changes: 30 additions & 1 deletion reactor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<protocPlugins>
Expand All @@ -17,6 +18,34 @@ To use Reactor-gRPC with the `protobuf-maven-plugin`, add a [custom protoc plugi
</protocPlugins>
```

### 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
Expand Down
32 changes: 30 additions & 2 deletions rx-java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<protocPlugins>
Expand All @@ -16,7 +17,34 @@ To use RxGrpc with the `protobuf-maven-plugin`, add a [custom protoc plugin conf
</protocPlugin>
</protocPlugins>
```
### 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
Expand Down

0 comments on commit ee72a76

Please sign in to comment.