method
stream_for
v7.2.3 -
Show latest stable
- Class:
ActionCable::Channel::Streams
stream_for(model, callback = nil, coder: nil, &block)public
Start streaming the pubsub queue for the `model` in this channel. Optionally, you can pass a `callback` that’ll be used instead of the default of just transmitting the updates straight to the subscriber.
Pass `coder: ActiveSupport::JSON` to decode messages as JSON before passing to the callback. Defaults to `coder: nil` which does no decoding, passes raw messages.