Package

org.suecarter

websocket

Permalink

package websocket

Visibility
  1. Public
  2. All

Type Members

  1. case class HighPriorityAckMailbox(settings: Settings, config: Config) extends PriorityUnboundedDequeMailbox with Product with Serializable

    Permalink

    When using context.become to wait for an Ack, then Ack will normally be placed at the end of the queue.

    When using context.become to wait for an Ack, then Ack will normally be placed at the end of the queue. This custom mailbox will prioritise Ack messages so that they are always placed at the front of the queue.

    This showed a performance improvement of 1 hour to 2 minutes when sending about 100,000 messages, as the client actor was spending the vast majority of its time traversing the work queue and re-stashing messages.

  2. abstract class PriorityUnboundedDequeMailbox extends MailboxType with ProducesMessageQueue[MessageQueue]

    Permalink

    Specialist priority (user provides the rules), unbounded, deque (can be used for Stashing) mailbox.

    Specialist priority (user provides the rules), unbounded, deque (can be used for Stashing) mailbox.

    Very useful for messages of high priority, such as Acks in I/O situations.

    Based on UnboundedDequeBasedMailbox from Akka.

  3. abstract class SimpleWebSocketComboWorker extends WebSocketComboWorker with HttpService

    Permalink

    Convenient, but not performance optimal, implementation of WebSocketComboWorker that recreates a Spray Route for every connection.

  4. trait SprayJsonSupport extends AnyRef

    Permalink
    Attributes
    protected
  5. abstract class WebSocketClient extends WebSocketClientWorker with Stash with WebSocketCommon

    Permalink

    Abstract actor that makes an HTTP connection request to the provided location and upgrades to WebSocket when connected.

    Abstract actor that makes an HTTP connection request to the provided location and upgrades to WebSocket when connected.

    NOTE: this uses a Stash so needs a dequeue mailbox. The included

    .withMailbox("org.suecarter.websocket.high-priority-ack-mailbox")

    is highly recommended.

  6. trait WebSocketClientSprayJsonSupport extends SprayJsonSupport

    Permalink
  7. abstract class WebSocketComboWorker extends Actor with ActorLogging with Stash with WebSocketCommon

    Permalink

    Provides a UHTTP-enabled worker for an HTTP connection with the ability to deal with both REST and WebSocket messages.

    Provides a UHTTP-enabled worker for an HTTP connection with the ability to deal with both REST and WebSocket messages.

    Mostly copied from WebSocketServerWorker with workarounds for acking and stashing.

  8. class WebSocketServer extends Actor with ActorLogging

    Permalink

    Spawns and registers WebSocket-capable worker actors with each new HTTP connection.

    Spawns and registers WebSocket-capable worker actors with each new HTTP connection. A convenience is provided in the companion to create a new web socket server.

    Caveats:

    1. Not possible to use IO(Http) and IO(Uhttp) in an ActorSystem: https://github.com/wandoulabs/spray-websocket/issues/44 Use the bundled pipelining instead of the Spray Client one (there may be other third party libraries that use IO(Http))

    2. An upgrade request on any path is valid (not restricted): https://github.com/wandoulabs/spray-websocket/issues/67

    3. Backpressure is implemented as a hack, because wandoulabs didn't consider this to be an important feature. https://github.com/wandoulabs/spray-websocket/issues/68

  9. trait WebSocketServerSprayJsonSupport extends SprayJsonSupport

    Permalink

    Provides conveniences to create pattern matchers for JSON-marshalled incoming Frame messages and for sending JSON-marshallable outgoing messages wrapped as CommandFrame.

Value Members

  1. object Ack extends Event with Droppable

    Permalink

    Ack received in response to WebSocketComboWorker.sendWithAck

  2. object PriorityUnboundedDequeMailbox

    Permalink
  3. object WebSocketServer

    Permalink
  4. object pipelining extends RequestBuilding with ResponseTransformation

    Permalink

    Copied from https://github.com/spray/spray/blob/master/spray-client/src/main/scala/spray/client/pipelining.scala#L35

    Copied from https://github.com/spray/spray/blob/master/spray-client/src/main/scala/spray/client/pipelining.scala#L35

    (copyright Spray, licensed Apache 2.0)

    Workaround for caveat #1 in WebSocket.scala.

Ungrouped