Export large file in Rails with Sidekiq

I think it can create a Model to store the export status, so that it can be queried at any time.

Then use the turbo stream broadcast to update the page.

I recently recorded a video (in Chinese) showing the usage of turbo stream broadcast:


I try to replace ActionCable.server.broadcastwith Turbo::StreamsChannel.broadcast_replace_to to broadcast HTML partial to users. It works. But I think ActionCable is the easier way in this case.

社区准则 博客 联系 反馈 状态