Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Side by Side Diff: pkg/analysis_server/lib/src/channel.dart

Issue 284353002: implement ByteStreamClientChannel close (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analysis_server/test/channel_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library channel; 5 library channel;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 import 'dart:io'; 9 import 'dart:io';
10 10
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 .transform(new ResponseConverter()) 195 .transform(new ResponseConverter())
196 .asBroadcastStream(); 196 .asBroadcastStream();
197 notificationStream = jsonStream 197 notificationStream = jsonStream
198 .where((json) => json[Notification.EVENT] != null) 198 .where((json) => json[Notification.EVENT] != null)
199 .transform(new NotificationConverter()) 199 .transform(new NotificationConverter())
200 .asBroadcastStream(); 200 .asBroadcastStream();
201 } 201 }
202 202
203 @override 203 @override
204 Future close() { 204 Future close() {
205 // TODO: implement close 205 return output.close();
206 } 206 }
207 207
208 @override 208 @override
209 Future<Response> sendRequest(Request request) { 209 Future<Response> sendRequest(Request request) {
210 String id = request.id; 210 String id = request.id;
211 output.writeln(JSON.encode(request.toJson())); 211 output.writeln(JSON.encode(request.toJson()));
212 return responseStream.firstWhere((Response response) => response.id == id); 212 return responseStream.firstWhere((Response response) => response.id == id);
213 } 213 }
214 } 214 }
215 215
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 } 346 }
347 } 347 }
348 } 348 }
349 349
350 @override 350 @override
351 void close() { 351 void close() {
352 closed = true; 352 closed = true;
353 sink.close(); 353 sink.close();
354 } 354 }
355 } 355 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/channel_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698