class Cable::Channel

Defined in:

cable/channel.cr

Constant Summary

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

Constructors

Class Method Summary

Instance Method Summary

Macro Summary

Constructor Detail

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

[View source]

Class Method Detail

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

[View source]
def self.broadcast_to(channel : String, message : String) #

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


[View source]
def self.broadcast_to(channel : String, message : Hash(String, String)) #

[View source]

Instance Method Detail

def broadcast(message : String) #

[View source]
def broadcast(message : JSON::Any) #

[View source]
def broadcast(message : Hash(String, String)) #

[View source]
def close #

[View source]
def connection : Cable::Connection #

[View source]
def identifier : String #

[View source]
def params : Hash(String, Cable::Payload::RESULT) #

[View source]
def perform(action, message) #

[View source]
def receive(message) #

[View source]
def reject #

[View source]
def run_after_subscribed_callbacks #

@override in after_subscribed macro


[View source]
def stream_from(stream_identifier : String | Symbol) #

[View source]
def stream_identifier : String | Nil #

[View source]
def subscribed #

[View source]
def subscription_rejected? : Bool #

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

broadcast single message to single connection for this channel


[View source]
def transmit(message : JSON::Any) #

broadcast single message to single connection for this channel


[View source]
def transmit(message : Hash(String, String)) #

broadcast single message to single connection for this channel


[View source]
def unsubscribed #

[View source]

Macro Detail

macro after_subscribed(*callbacks) #

Run block after the subscription is created.


[View source]