method
perform_write
v5.2.3 -
Show latest stable
- Class:
ActionController::Live::SSE
perform_write(json, options)private
No documentation available.
# File actionpack/lib/action_controller/metal/live.rb, line 111
def perform_write(json, options)
current_options = @options.merge(options).stringify_keys
WHITELISTED_OPTIONS.each do |option_name|
if (option_value = current_options[option_name])
@stream.write "#{option_name}: #{option_value}\n"
end
end
message = json.gsub("\n".freeze, "\ndata: ".freeze)
@stream.write "data: #{message}\n\n"
end