Open
Description
If I have a short-lived Rails Runner script that calls broadcast_refresh_later_to
, it won't get emitted because the script will end before the debouncer's scheduled task hits its delay.
turbo-rails/app/channels/turbo/streams/broadcasts.rb
Lines 73 to 75 in cb47713
My workaround is to do this at the end of my script, but it's not my favorite:
sleep Turbo::Debouncer::DEFAULT_DELAY + 0.1
It might be nice to keep an Weakmap or something of all of the Turbo::Debounce
instances to do something more elegant than sleep (like rescheduling the ScheduledTask to now). I guess I could grab them out of ObjectSpace too. Mostly flagging this as a weird edge case cause I was real confused for 15 minutes till I discovered the cause.
Metadata
Metadata
Assignees
Labels
No labels