class

ActionCable::CorkWriter

Inherits Reference < Object

Constants

MAX_BUFFER = 1048576

Constructors

new(io : IO, iolock : Mutex)
Source

Class methods

text_frame(text : String) : Bytes

Builds a complete outgoing text frame. Server→client frames are unmasked, so one pre-encoded frame can be written to every socket verbatim.

Source

Instance methods

buffered_amount
Source
close

Drains what is left and stops the writer fiber.

Source
deliver_frame(frame : Bytes) : Nil

Buffers an already-encoded frame (see .text_frame) — encode-once fan-out: the same bytes go to every socket.

Source
deliver_text(text : String) : Nil

Frames and buffers one text message.

Source
dropped_messages
flush

Writes out buffered frames synchronously — used before a WS close handshake (remote disconnect) so the disconnect frame precedes the close frame on the wire.

Source