From a873d77fbeb4590dceeb893ab067beb9058db241 Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Mon, 13 Aug 2018 15:00:14 +0800 Subject: Tweak websocket tests, example and docs --- docs/pages/1 - Cask: a Scala HTTP micro-framework .md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/pages/1 - Cask: a Scala HTTP micro-framework .md b/docs/pages/1 - Cask: a Scala HTTP micro-framework .md index 131d06b..df79f09 100644 --- a/docs/pages/1 - Cask: a Scala HTTP micro-framework .md +++ b/docs/pages/1 - Cask: a Scala HTTP micro-framework .md @@ -319,6 +319,13 @@ Returning a `cask.Response` immediately closes the websocket connection, and is useful if you want to e.g. return a 404 or 403 due to the initial request being invalid. +Cask intentionally provides a relatively low-level websocket interface. It +leaves it up to you to manage open channels, react to incoming messages, or +pro-actively send them out, mostly using the underlying Undertow webserver +interface. While Cask does not model streams, backpressure, iteratees, or +provide any higher level API, it should not be difficult to take the Cask API +and build whatever higher-level abstractions you prefer to use. + ### TodoMVC Api Server @@ -396,9 +403,7 @@ need some low-level functionality not exposed by the Cask API, you can override `defaultHandler` to make use of Undertow's own [handler API](http://undertow.io/undertow-docs/undertow-docs-2.0.0/index.html#built-in-handlers) for customizing your webserver. This allows for things that Cask itself doesn't -internally support: asynchronous requests & response, -[Websockets](http://undertow.io/undertow-docs/undertow-docs-2.0.0/index.html#websockets), -etc. +internally support. ### def port: Int = 8080, def host: String = "localhost" -- cgit v1.2.3