From fdd1ca16c959eed7614253accc6f8772c8d32331 Mon Sep 17 00:00:00 2001 From: Tobe O Date: Tue, 28 Aug 2018 09:47:03 -0400 Subject: [PATCH] Added ResponseContext.detach --- lib/src/core/response_context.dart | 6 ++++++ test/parameter_meta_test.dart | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/src/core/response_context.dart b/lib/src/core/response_context.dart index aa821151..23cd1e7f 100644 --- a/lib/src/core/response_context.dart +++ b/lib/src/core/response_context.dart @@ -91,6 +91,12 @@ abstract class ResponseContext /// The underlying [RawResponse] under this instance. RawResponse get rawResponse; + /// Signals Angel that the response is being held alive deliberately, and that the framework should not automatically close it. + /// + /// This is mostly used in situations like WebSocket handlers, where the connection should remain + /// open indefinitely. + RawResponse detach(); + /// Gets or sets the content type to send back to a client. MediaType contentType = new MediaType('text', 'plain'); diff --git a/test/parameter_meta_test.dart b/test/parameter_meta_test.dart index e4a6ea4f..faa6e4b4 100644 --- a/test/parameter_meta_test.dart +++ b/test/parameter_meta_test.dart @@ -1,6 +1,5 @@ import 'dart:async'; import 'dart:convert'; -import 'dart:io'; import 'package:angel_container/mirrors.dart'; import 'package:angel_framework/angel_framework.dart';