Skip to content

Commit e8f8397

Browse files
Refactor streaming methods to use consumer_stream_async for improved async handling
1 parent ecd1552 commit e8f8397

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

react_on_rails_pro/app/helpers/react_on_rails_pro_helper.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def stream_react_component(component_name, options = {})
132132
# Extract streaming-specific callback
133133
on_complete = options.delete(:on_complete)
134134

135-
run_stream_inside_fiber(on_complete: on_complete) do
135+
consumer_stream_async(on_complete: on_complete) do
136136
internal_stream_react_component(component_name, options)
137137
end
138138
end
@@ -193,7 +193,7 @@ def rsc_payload_react_component(component_name, options = {})
193193
# Extract streaming-specific callback
194194
on_complete = options.delete(:on_complete)
195195

196-
run_stream_inside_fiber(on_complete: on_complete) do
196+
consumer_stream_async(on_complete: on_complete) do
197197
internal_rsc_payload_react_component(component_name, options)
198198
end
199199
end
@@ -298,7 +298,7 @@ def check_caching_options!(raw_options, block)
298298
raise ReactOnRailsPro::Error, "Option 'cache_key' is required for React on Rails caching"
299299
end
300300

301-
def run_stream_inside_fiber(on_complete:)
301+
def consumer_stream_async(on_complete:)
302302
require "async/variable"
303303

304304
if @async_barrier.nil?

0 commit comments

Comments
 (0)