abstract class Cable::Connection

Defined in:

cable/connection.cr

Constant Summary

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

Constructors

Class Method Summary

Instance Method Summary

Macro Summary

Constructor Detail

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

[View source]

Class Method Detail

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

[View source]

Instance Method Detail

def close #

[View source]
def closed? : Bool #

[View source]
abstract def connect #

[View source]
def connection_identifier : String #

[View source]
def connection_identifier=(connection_identifier : String) #

[View source]
def connection_rejected? : Bool #

[View source]
def connection_requesting_duplicate_channel_subscription?(payload) #

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


[View source]
def identifier #

[View source]
def internal_identifier : String #

[View source]
def internal_identifier=(internal_identifier : String) #

[View source]
def message(payload : Cable::Payload) #

[View source]
def receive(message : String) #

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


[View source]
def reject(payload : Cable::Payload) #

[View source]
def reject_unauthorized_connection #

[View source]
def send_message(message : String) #

[View source]
def socket : HTTP::WebSocket #

[View source]
def started_at : Time #

[View source]
def subscribe(payload : Cable::Payload) #

[View source]
def token : String | Nil #

[View source]
def unsubscribe(payload : Cable::Payload) #

[View source]

Macro Detail

macro identified_by(name) #

[View source]
macro owned_by(type_definition) #

[View source]