class

Cable::Connection

Inherits Reference < Object

Constants

CHANNELS = {} of String => Hash(String, Cable::Channel)
CHANNELS_MUTEX = Mutex.new

Constructors

new(request : HTTP::Request, socket : HTTP::WebSocket)
Source

Class methods

broadcast_to(channel : String, message : String)
Source

Instance methods

channels
Source
close
Source
closed?
Source
connect
Source
connection_identifier
Source
connection_identifier=(connection_identifier : String)
Source
connection_rejected?
Source
connection_requesting_duplicate_channel_subscription?(payload)

ensure we only allow subscribing to the same channel once from a connection

Source
identifier
Source
internal_identifier
Source
internal_identifier=(internal_identifier : String)
Source
message(payload : Cable::Payload)
Source
receive(message : String)

Convert the message to a proper Payload. The Cable::Handler will handle catching SerializableError, and close the socket and connection

Source
reject(payload : Cable::Payload)
Source
reject_unauthorized_connection
Source
send_message(message : String)
Source
socket
Source
started_at
Source
subscribe(payload : Cable::Payload)
Source
token
Source
unsubscribe(payload : Cable::Payload)
Source

Macros

identified_by(name)
Source
owned_by(type_definition)
Source

Nested types