instance method default_stream_handler

Ruby on Rails 8.0.4

Since v5.2.8.1 Private

Available in: v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

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

broadcasting req
coder keyreq
Source
# File actioncable/lib/action_cable/channel/streams.rb, line 191
        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 191 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionCable::Channel::Streams

Type at least 2 characters to search.

↑↓ navigate · open · esc close