class Cable::Channel
- Cable::Channel
- Reference
- Object
Defined in:
cable/channel.crConstant Summary
-
CHANNELS =
{} of String => Cable::Channel.class
Constructors
Class Method Summary
- .broadcast_to(channel : String, message : JSON::Any)
-
.broadcast_to(channel : String, message : String)
It's important that we don't call message.to_json
- .broadcast_to(channel : String, message : Hash(String, String))
Instance Method Summary
- #broadcast(message : String)
- #broadcast(message : JSON::Any)
- #broadcast(message : Hash(String, String))
- #close
- #connection : Cable::Connection
- #identifier : String
- #params : Hash(String, Cable::Payload::RESULT)
- #perform(action, message)
- #receive(message)
- #reject
-
#run_after_subscribed_callbacks
@override in after_subscribed macro
- #stream_from(stream_identifier : String | Symbol)
- #stream_identifier : String | Nil
- #subscribed
- #subscription_rejected? : Bool
-
#transmit(message : String)
broadcast single message to single connection for this channel
-
#transmit(message : JSON::Any)
broadcast single message to single connection for this channel
-
#transmit(message : Hash(String, String))
broadcast single message to single connection for this channel
- #unsubscribed
Macro Summary
-
after_subscribed(*callbacks)
Run
block
after the subscription is created.
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 : String)
#
It's important that we don't call message.to_json
Instance Method Detail
def transmit(message : Hash(String, String))
#
broadcast single message to single connection for this channel