ActionCable::Channel::Base
Constructors
Class methods
--- stream_for / broadcast_to (gem's Streams + Naming) ---------- broadcasting_for: [channel_name, *broadcastables].join(":"), каждый элемент — gid AR-записи или to_s (оракул stream_for_expected.yml).
Timers registered for this class via periodically (generated
per subclass below; subclasses inherit ancestor timers).
Instance methods
Overridden per-subclass by end-of-program codegen (below).
Overridden per-subclass by end-of-program codegen (below): block timers dispatch to their generated methods.
Macros
Periodically performs a task while the channel is subscribed (the gem's Channel::PeriodicTimers, timer semantics 1:1): timers start after #subscribed (after_subscribe) and stop on unsubscribe_from_channel (after_unsubscribe).
periodically :transmit_progress, every: 5.seconds periodically every: 3.minutes do transmit({action: "update_count"} of String => CableValue) end
A method name or a block, plus the every: interval (a
Time::Span or a number of seconds). Deviation from the Ruby DSL:
this is a macro (class-body DSL), so the callable form is a
block or a method name only; the block runs as a generated
channel method with the channel as self, like Ruby's
instance_exec.