Added ResponseContext.detach

This commit is contained in:
Tobe O 2018-08-28 09:47:03 -04:00
parent ed5632d11f
commit fdd1ca16c9
2 changed files with 6 additions and 1 deletions

View file

@ -91,6 +91,12 @@ abstract class ResponseContext<RawResponse>
/// 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');

View file

@ -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';