class Cable::Channel

Defined in:

cable/channel.cr

Constant Summary

CHANNELS = {} of String => Cable::Channel.class

Constructors

Class Method Summary

Macro Summary

Instance Method Summary

Constructor Detail

def self.new(connection : Cable::Connection, identifier : String, params : Hash(String, Cable::Payload::RESULT)) #

Class Method Detail

def self.broadcast_to(channel : String, message : JSON::Any | Hash(String, String)) #

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

It's important that we don't call message.to_json


Macro Detail

macro after_subscribed(*callbacks) #

Run block after the subscription is created.


Instance Method Detail

def broadcast(message : String | JSON::Any | Hash(String, String)) #

def close #

def connection : Cable::Connection #

def identifier : String #

def params : Hash(String, Cable::Payload::RESULT) #

def perform(action, message) #

def receive(message) #

def reject #

def run_after_subscribed_callbacks #

@override in after_subscribed macro


def stream_from(stream_identifier : String | Symbol) #

def stream_identifier : String | Nil #

def subscribed #

def subscription_rejected? : Bool #

def transmit(message : String | JSON::Any | Hash(String, String)) #

broadcast single message to single connection for this channel


def unsubscribed #