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

Unified Diff: sdk/lib/io/http_impl.dart

Issue 298143003: Put delivering of parsed http-requests at the end of the message-queue. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/http_impl.dart
diff --git a/sdk/lib/io/http_impl.dart b/sdk/lib/io/http_impl.dart
index c7e1a5f4a714a0a8920e36fb1980fbff6b4a6262..e4f366db1bf47e61c5e423f52e90ff6f7a7a2c1d 100644
--- a/sdk/lib/io/http_impl.dart
+++ b/sdk/lib/io/http_impl.dart
@@ -2190,7 +2190,17 @@ class _HttpServer
_sessionManager.sessionTimeout = timeout;
}
- void _handleRequest(HttpRequest request) => _controller.add(request);
+ void _handleRequest(_HttpRequest request) {
+ // Delay the request until the isolate's message-queue is handled.
+ // This greatly improves scheduling when a lot of requests are active.
+ Timer.run(() {
+ if (!closed) {
+ _controller.add(request);
+ } else {
+ request._httpConnection.destroy();
+ }
+ });
+ }
void _handleError(error) {
if (!closed) _controller.addError(error);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698