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

Side by Side Diff: example/http_server.dart

Issue 1025293003: pkg/isolate: library renaming, removed unused method, fix creation of TimeoutException (Closed) Base URL: https://github.com/dart-lang/isolate.git@master
Patch Set: nits Created 5 years, 9 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
« no previous file with comments | « example/http-server.dart ('k') | example/runner-pool.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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 dart.pkg.isolate.sample.httpserver; 5 library isolate.example.http_server;
6 6
7 import "dart:async";
7 import "dart:io"; 8 import "dart:io";
8 import "dart:async";
9 import "dart:isolate"; 9 import "dart:isolate";
10 import "package:isolate/isolaterunner.dart"; 10
11 import 'package:isolate/isolate_runner.dart';
12 import "package:isolate/ports.dart";
11 import "package:isolate/runner.dart"; 13 import "package:isolate/runner.dart";
12 import "package:isolate/ports.dart";
13 14
14 typedef Future RemoteStop(); 15 typedef Future RemoteStop();
15 16
16 Future<RemoteStop> runHttpServer( 17 Future<RemoteStop> runHttpServer(
17 Runner runner, ServerSocket socket, HttpListener listener) { 18 Runner runner, ServerSocket socket, HttpListener listener) {
18 return runner.run(_startHttpServer, new List(2)..[0] = socket.reference 19 return runner.run(_startHttpServer, new List(2)..[0] = socket.reference
19 ..[1] = listener) 20 ..[1] = listener)
20 .then((SendPort stopPort) => () => _sendStop(stopPort)); 21 .then((SendPort stopPort) => () => _sendStop(stopPort));
21 } 22 }
22 23
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 stoppers.forEach((f) => f()); 107 stoppers.forEach((f) => f());
107 counter.close(); 108 counter.close();
108 } 109 }
109 }; 110 };
110 print("Server listening on port $port for 25 requests"); 111 print("Server listening on port $port for 25 requests");
111 print("Test with:"); 112 print("Test with:");
112 print(" ab -c10 -n 25 http://localhost:$port/"); 113 print(" ab -c10 -n 25 http://localhost:$port/");
113 }); 114 });
114 }); 115 });
115 } 116 }
OLDNEW
« no previous file with comments | « example/http-server.dart ('k') | example/runner-pool.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698