abstract class Cable::Connection

Defined in:

cable/connection.cr

Constant Summary

CHANNELS = {} of String => Hash(String, Cable::Channel)

Constructors

Class Method Summary

Macro Summary

Instance Method Summary

Constructor Detail

def self.new(request : HTTP::Request, socket : HTTP::WebSocket) #

Class Method Detail

def self.broadcast_to(channel : String, message : String) #

Macro Detail

macro identified_by(name) #

macro owned_by(type_definition) #

Instance Method Detail

def channels : Array(Cable::Channel) #

def close #

def closed? : Bool #

abstract def connect #

def connection_identifier : String #

def connection_identifier=(connection_identifier : String) #

def connection_rejected? : Bool #

def connection_requesting_duplicate_channel_subscription?(payload) #

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


def identifier #

def internal_identifier : String #

def internal_identifier=(internal_identifier : String) #

def message(payload : Cable::Payload) #

def receive(message : String) #

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


def reject(payload : Cable::Payload) #

def reject_unauthorized_connection #

def send_message(message : String) #

def socket : HTTP::WebSocket #

def started_at : Time #

def subscribe(payload : Cable::Payload) #

def token : String | Nil #

def unsubscribe(payload : Cable::Payload) #