instance method
default_stream_handler
Ruby on Rails 7.1.6
Since v5.2.8.1 PrivateSignature
default_stream_handler(broadcasting, coder:)
May be overridden to change the default stream handling behavior which decodes JSON and transmits to the client.
TODO: Tests demonstrating this.
TODO: Room for optimization. Update transmit API to be coder-aware so we can no-op when pubsub and connection are both JSON-encoded. Then we can skip decode+encode if we’re just proxying messages.
Parameters
-
broadcastingreq -
coderkeyreq
Source
# File actioncable/lib/action_cable/channel/streams.rb, line 176
def default_stream_handler(broadcasting, coder:)
coder ||= ActiveSupport::JSON
stream_transmitter stream_decoder(coder: coder), broadcasting: broadcasting
end
Defined in actioncable/lib/action_cable/channel/streams.rb line 176
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionCable::Channel::Streams