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

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

Issue 228453002: Add bufferOutput to HttpServer, HttpResponse and HttpClientRequest. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 | sdk/lib/io/http_impl.dart » ('j') | sdk/lib/io/http_impl.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/http.dart
diff --git a/sdk/lib/io/http.dart b/sdk/lib/io/http.dart
index db973dd4a906a6c4227fd24bd3d0629f58afce5b..ebd3c66edbef6cd0fc37ecd6bbe60f46dee44960 100644
--- a/sdk/lib/io/http.dart
+++ b/sdk/lib/io/http.dart
@@ -175,6 +175,20 @@ abstract class HttpServer implements Stream<HttpRequest> {
*/
Duration idleTimeout;
+
+ /**
+ * Get or set if the HttpServer should buffer output, by default.
+ *
+ * This setting is also changable at the individual [HttpResponse]s.
+ *
+ * Default is `true`.
+ *
+ * __Note__: Disabling buffering of the output can result in very poor
+ * performance, when writing many small chunks.
+ */
+ bool bufferOutput;
Søren Gjesse 2014/04/08 11:54:25 Do we need this default? I assume this will only b
Anders Johnsen 2014/04/08 12:40:07 Good point. Will remove this one.
+
+
/**
* Starts listening for HTTP requests on the specified [address] and
* [port].
@@ -1083,6 +1097,16 @@ abstract class HttpResponse implements IOSink {
Duration deadline;
/**
+ * Get or set if the [HttpResponse] should buffer output.
+ *
+ * Default value is that of [HttpServer.bufferOutput].
+ *
+ * __Note__: Disabling buffering of the output can result in very poor
+ * performance, when writing many small chunks.
+ */
+ bool bufferOutput;
+
+ /**
* Returns the response headers.
*
* The response headers can be modified until the response body is
@@ -1564,6 +1588,16 @@ abstract class HttpClientRequest implements IOSink {
int contentLength;
/**
+ * Get or set if the [HttpClientRequest] should buffer output.
+ *
+ * Default value is `true`.
+ *
+ * __Note__: Disabling buffering of the output can result in very poor
+ * performance, when writing many small chunks.
+ */
+ bool bufferOutput;
+
+ /**
* Returns the client request headers.
*
* The client request headers can be modified until the client
@@ -1605,7 +1639,7 @@ abstract class HttpClientRequest implements IOSink {
* the data and be notified when the entire body is received.
*
* new HttpClient().get('localhost', 80, '/file.txt')
- * .then((HttpClientRequeset request) => request.close())
+ * .then((HttpClientRequest request) => request.close())
* .then((HttpClientResponse response) {
* response.transform(UTF8.decoder).listen((contents) {
* // handle data
« no previous file with comments | « no previous file | sdk/lib/io/http_impl.dart » ('j') | sdk/lib/io/http_impl.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698