Class/Object

play.socketio

SocketIOEvent

Related Docs: object SocketIOEvent | package socketio

Permalink

case class SocketIOEvent(name: String, arguments: Seq[Either[JsValue, ByteString]], ack: Option[SocketIOEventAck]) extends Product with Serializable

A socket.io event.

A socket.io event consists of a name (which is used on the client side to register handlers for events), and a set of arguments associated with that event.

The arguments mirror the structure in JavaScript, when you publish an event, you pass the event name, and then several arguments. When you subscribe to an event, you declare a function that takes zero or more arguments. Consequently, the arguments get modelled as a sequence.

Furthermore, socket.io allows you to pass either a structure that can be serialized to JSON (in the Play world, this is a JsValue), or a binary argument (in the Play world, this is a ByteString). Hence, each argument is Either[JsValue, ByteString].

Finally, as the last argument, socket.io allows the emitter to pass an ack function. This then gets passed to the consumer as the last argument to their callback function, and they can invoke it, and the arguments passed to it will be serialized to the wire, and passed to the function registered on the other side.

name

The name of the event.

arguments

The list of arguments.

ack

An optional ack function.

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SocketIOEvent
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SocketIOEvent(name: String, arguments: Seq[Either[JsValue, ByteString]], ack: Option[SocketIOEventAck])

    Permalink

    name

    The name of the event.

    arguments

    The list of arguments.

    ack

    An optional ack function.

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. val ack: Option[SocketIOEventAck]

    Permalink

    An optional ack function.

  5. val arguments: Seq[Either[JsValue, ByteString]]

    Permalink

    The list of arguments.

  6. final def asInstanceOf[T0]: T0

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

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

    Permalink
    Definition Classes
    AnyRef
  9. def finalize(): Unit

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

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

    Permalink
    Definition Classes
    Any
  12. val name: String

    Permalink

    The name of the event.

  13. final def ne(arg0: AnyRef): Boolean

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

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

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

    Permalink
    Definition Classes
    AnyRef
  17. final def wait(): Unit

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

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

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

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped