WebSocket

play.api.mvc.WebSocket
See theWebSocket companion trait
object WebSocket

Helper utilities to generate WebSocket results.

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
WebSocket.type

Members list

Type members

Classlikes

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait MessageFlowTransformer[+In, -Out]

Transforms WebSocket message flows into message flows of another type.

Transforms WebSocket message flows into message flows of another type.

The transformation may be more than just converting from one message to another, it may also produce messages, such as close messages with an appropriate error code if the message can't be consumed.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Self type

Types

A function that, given an actor to send upstream messages to, returns actor props to create an actor to handle the WebSocket

A function that, given an actor to send upstream messages to, returns actor props to create an actor to handle the WebSocket

Attributes

Value members

Concrete methods

def accept[In, Out](f: RequestHeader => Flow[In, Out, _])(implicit transformer: MessageFlowTransformer[In, Out]): WebSocket

Accepts a WebSocket using the given flow.

Accepts a WebSocket using the given flow.

Attributes

def acceptOrResult[In, Out](f: RequestHeader => Future[Either[Result, Flow[In, Out, _]]])(implicit transformer: MessageFlowTransformer[In, Out]): WebSocket

Creates an action that will either accept the websocket, using the given flow to handle the in and out stream, or return a result to reject the Websocket.

Creates an action that will either accept the websocket, using the given flow to handle the in and out stream, or return a result to reject the Websocket.

Attributes