Skip to content

Commit

Permalink
Multiplex RPCs on a single connection. (#34)
Browse files Browse the repository at this point in the history
A Channel will now multiplex RPCs on a single managed connection. The
connection will attempt to reconnect on failure, and will close the
underlying transport connection if no RPCs have been made for a while.

Part of #5.
  • Loading branch information
jakobr-google authored Oct 12, 2017
1 parent a9b919a commit 7b2ff3e
Show file tree
Hide file tree
Showing 8 changed files with 395 additions and 99 deletions.
15 changes: 10 additions & 5 deletions example/route_guide/lib/src/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,17 @@ class Client {
Future<Null> main(List<String> args) async {
channel = new ClientChannel('127.0.0.1',
port: 8080, options: const ChannelOptions.insecure());
stub = new RouteGuideClient(channel);
stub = new RouteGuideClient(channel,
options: new CallOptions(timeout: new Duration(seconds: 30)));
// Run all of the demos in order.
await runGetFeature();
await runListFeatures();
await runRecordRoute();
await runRouteChat();
try {
await runGetFeature();
await runListFeatures();
await runRecordRoute();
await runRouteChat();
} catch (e) {
print('Caught error: $e');
}
await channel.shutdown();
}

Expand Down
Loading

0 comments on commit 7b2ff3e

Please sign in to comment.