Skip to content

Commit 1aab14a

Browse files
committed
Update/clarify the readme, use released recipes, better clean
1 parent b17c337 commit 1aab14a

2 files changed

Lines changed: 39 additions & 6 deletions

File tree

README.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,27 @@ For these reasons, other gRPC clients such as (improbable-eng/grpc-web)[https://
5252
have included a websocket transport for gRPC messages. Unfortunately, that repository is no longer maintained, and some
5353
features we have found to be necessary were never shipped or never implemented.
5454

55-
This library includes two websocket transports - the first is compatible with improbable-eng/grpc-web using one
55+
A simple `fetch()` implementation is provided which supports unary and server-streaming calls, but by itself cannot
56+
support other streaming calls.
57+
58+
### Unfinished transports
59+
This library will include two websocket transports - the first is compatible with improbable-eng/grpc-web using one
5660
websocket per stream, and the second supports using a single websocket for multiple streams to the same server (in
5761
roughly the same way that http2 would do with streams on a single socket). The first is included for compatibility with
5862
any existing proxies that support this feature - we mostly encourage the use of the second where required.
5963

64+
Another implementation will be provided that uses server-streaming `fetch()` requests to receive messages for a given
65+
stream, and a unary `fetch()` to send messages. These can be paired with a server-side tools to modify a Java
66+
`BindableService` to include pairs of gRPC methods which will be treated by the real server method as a single streaming
67+
method. Some implementation details are likely to be left out, specifically around handling the state of pairing up
68+
messages etc, and naturally any reverse proxy would be required to forward all calls to the same server to be handled
69+
uniformly.
70+
6071
## Usage
6172

62-
Add `com.vertispan.protobuf:protobuf-gwt` to your project dependencies. The version will be based on the
63-
protobuf-java build being used, with an integer suffix to allow for packaging changes. For example, current
64-
released versions:
73+
Add `com.vertispan.grpc:grpc-web-gwt` to your project dependencies, replacing `io.grpc:grpc-*` dependencies. The
74+
version will be based on the grpc-java build being used, with an integer suffix to allow for packaging changes. For
75+
example, current released versions:
6576

6677
| grpc-java | grpc-gwt | Description |
6778
|-----------|----------|--------------------------------------------------------------------------|
@@ -72,7 +83,11 @@ Replace/exclude any existing grpc-java dependencies with this library. Add an in
7283
<inherits name="io.grpc.Grpc" />
7384
```
7485

75-
Then, use the gRPC APIs as you would normally. The gRPC-web Channel is available as `GrpcWebChannel` in the
86+
Then, generate your own stubs as normal with protoc, taking care to only use the async stubs.
87+
88+
Additionally, one or more `io.grpc.Channel` implementation should be picked from the provided dependencies, and passed to
89+
the `newStub(..)` method when creating your generated client service.
90+
7691

7792
## Building
7893

pom.xml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
<dependency>
156156
<groupId>com.vertispan.recipes</groupId>
157157
<artifactId>gwt-compatible-recipes</artifactId>
158-
<version>2.0-SNAPSHOT</version>
158+
<version>2.0</version>
159159
</dependency>
160160
</dependencies>
161161
</plugin>
@@ -168,6 +168,24 @@
168168
<moduleName>io.grpc.Grpc</moduleName>
169169
</configuration>
170170
</plugin>
171+
<plugin>
172+
<groupId>org.apache.maven.plugins</groupId>
173+
<artifactId>maven-clean-plugin</artifactId>
174+
<version>3.4.1</version>
175+
<configuration>
176+
<!-- Also configure the plugin to remove the unpacked+rewritten sources -->
177+
<filesets>
178+
<fileset>
179+
<directory>src/main/java</directory>
180+
<includes>
181+
<include>io/</include>
182+
<include>META-INF/</include>
183+
</includes>
184+
</fileset>
185+
</filesets>
186+
</configuration>
187+
</plugin>
188+
171189
</plugins>
172190
</build>
173191

0 commit comments

Comments
 (0)