When using context.become to wait for an Ack, then Ack will
normally be placed at the end of the queue.
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.
Convenient, but not performance optimal, implementation of
WebSocketComboWorker that recreates a Spray Route for every
connection.
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.
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.
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
Provides conveniences to create pattern matchers for
JSON-marshalled incoming Frame messages and for sending
JSON-marshallable outgoing messages wrapped as CommandFrame.
Ack received in response to WebSocketComboWorker.sendWithAck
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.
When using
context.becometo wait for anAck, thenAckwill normally be placed at the end of the queue. This custom mailbox will prioritiseAckmessages 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.