Object/Trait

play.sockjs.api

SockJS

Related Docs: trait SockJS | package api

Permalink

object SockJS

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SockJS
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type HandlerProps = (ActorRef) ⇒ Props

    Permalink

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

  2. trait MessageFlowTransformer[+In, -Out] extends AnyRef

    Permalink

    Transforms SockJS message flows into flows of another type.

    Transforms SockJS message flows into 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.

  3. type MessageFormatter[A] = MessageFlowTransformer[A, A]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.5.0) Use MessageFormatter instead

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. object MessageFlowTransformer

    Permalink

    Defaults message transformers.

  5. object MessageFormatter

    Permalink

    Defaults (old) message formatters.

  6. def accept[In, Out](f: (RequestHeader) ⇒ Flow[In, Out, _])(implicit transformer: MessageFlowTransformer[In, Out]): SockJS

    Permalink

    Accepts a SockJS using the given flow.

  7. def acceptOrResult[In, Out](f: (RequestHeader) ⇒ Future[Either[Result, Flow[In, Out, _]]])(implicit transformer: MessageFlowTransformer[In, Out]): SockJS

    Permalink

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

  8. def apply(f: (RequestHeader) ⇒ Future[Either[Result, Flow[Frame, Frame, _]]]): SockJS

    Permalink
  9. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  15. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  21. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  22. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def acceptWithActor[In, Out](f: (RequestHeader) ⇒ HandlerProps)(implicit transformer: MessageFlowTransformer[In, Out], app: api.Application, mat: Materializer): SockJS

    Permalink

    Create a SockJS handler that will pass messages to/from the actor created by the given props.

    Create a SockJS handler that will pass messages to/from the actor created by the given props.

    Given a request and an actor ref to send messages to, the function passed should return the props for an actor to create to handle this SockJS connection.

    For example:

    def sockjs = SockJS.acceptWithActor[JsValue, JsValue] { req => out =>
      MySockJSActor.props(out)
    }
    Annotations
    @deprecated
    Deprecated

    (Since version 0.5.0) Use accept with a flow that wraps a Sink.actorRef and Source.actorRef, or play.api.libs.ActorFlow.actorRef

  2. def adapter[A](f: (RequestHeader) ⇒ Enumeratee[A, A])(implicit transformer: MessageFlowTransformer[A, A]): SockJS

    Permalink

    Creates a SockJS handler that will adapt the incoming stream and send it back out.

    Creates a SockJS handler that will adapt the incoming stream and send it back out.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.5.0) Use accept with an Akka streams flow instead

  3. def tryAccept[A](f: (RequestHeader) ⇒ Future[Either[Result, (Iteratee[A, _], Enumerator[A])]])(implicit transformer: MessageFlowTransformer[A, A]): SockJS

    Permalink

    Creates a SockJS handler that will either reject the connection with the given result, or will be handled by the given inbound and outbound channels, asynchronously

    Creates a SockJS handler that will either reject the connection with the given result, or will be handled by the given inbound and outbound channels, asynchronously

    Annotations
    @deprecated
    Deprecated

    (Since version 0.5.0) Use acceptOrResult with an Akka streams flow instead

  4. def tryAcceptWithActor[In, Out](f: (RequestHeader) ⇒ Future[Either[Result, HandlerProps]])(implicit transformer: MessageFlowTransformer[In, Out], app: api.Application, mat: Materializer): SockJS

    Permalink

    Create a SockJS handler that will pass messages to/from the actor created by the given props asynchronously.

    Create a SockJS handler that will pass messages to/from the actor created by the given props asynchronously.

    Given a request, this method should return a future of either:

    - A result to reject the WebSocket with, or - A function that will take the sending actor, and create the props that describe the actor to handle this SockJS connection

    For example:

    def subscribe = SockJS.acceptWithActor[JsValue, JsValue] { req =>
      val isAuthenticated: Future[Boolean] = authenticate(req)
      val isAuthenticated.map {
        case false => Left(Forbidden)
        case true => Right(MySockJSActor.props)
      }
    }
    Annotations
    @deprecated
    Deprecated

    (Since version 0.5.0) Use accept with a flow that wraps a Sink.actorRef and Source.actorRef, or play.api.libs.ActorFlow.actorRef

  5. def using[A](f: (RequestHeader) ⇒ (Iteratee[A, _], Enumerator[A]))(implicit transformer: MessageFlowTransformer[A, A]): SockJS

    Permalink

    Accepts a SockJS connection using the given inbound/outbound channels.

    Accepts a SockJS connection using the given inbound/outbound channels.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.5.0) Use accept with an Akka streams flow instead

Inherited from AnyRef

Inherited from Any

Ungrouped