WebSocket connection adapter for Ring/Jetty.
Wraps Ring WebSocket implementation to provide IWebSocketConnection protocol. Handles JSON encoding/decoding and WebSocket frame transmission.
Responsibilities (Shell/I/O):
WebSocket connection adapter for Ring/Jetty. Wraps Ring WebSocket implementation to provide IWebSocketConnection protocol. Handles JSON encoding/decoding and WebSocket frame transmission. Responsibilities (Shell/I/O): - Send messages over WebSocket (I/O operation) - Close WebSocket connections (I/O operation) - JSON encoding (external format transformation) - Error handling and logging
(create-ring-websocket-adapter connection-id ws-channel)Create WebSocket adapter for Ring WebSocket channel.
Args: connection-id - UUID for connection ws-channel - Ring WebSocket channel map with: :send! - Function to send message :close! - Function to close connection :open? - Function to check if open
Returns: RingWebSocketAdapter instance implementing IWebSocketConnection
Create WebSocket adapter for Ring WebSocket channel.
Args:
connection-id - UUID for connection
ws-channel - Ring WebSocket channel map with:
:send! - Function to send message
:close! - Function to close connection
:open? - Function to check if open
Returns:
RingWebSocketAdapter instance implementing IWebSocketConnection(create-test-websocket-adapter connection-id)Create test WebSocket adapter for testing (in-memory).
Args: connection-id - UUID for connection
Returns: TestWebSocketAdapter instance with: - sent-messages atom (vector of sent messages) - open-state atom (boolean)
Create test WebSocket adapter for testing (in-memory).
Args:
connection-id - UUID for connection
Returns:
TestWebSocketAdapter instance with:
- sent-messages atom (vector of sent messages)
- open-state atom (boolean)cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |