David Kimura PRO said over 4 years ago on Real-time posts with Action Cable in Rails 6 :
Check out https://www.driftingruby.com/episodes/realtime-client-updates-from-background-jobs-with-stimulus It uses a whole combination of things. StimulusJS, ActionCable, ActiveJob, AJAX, etc.