Move experience broadcasts to async Sidekiq job#213
Open
JaredShay wants to merge 4 commits into
Open
Conversation
JaredShay
force-pushed
the
segment-performance-improvements
branch
2 times, most recently
from
June 17, 2026 18:30
6605b8a to
44b9e1f
Compare
Replace all synchronous broadcast_experience_update calls with a
coalescing Sidekiq job (BroadcastUpdateJob) that uses
sidekiq-unique-jobs lock: :until_executing per experience_id.
This caps inflight work at 1 executing + 1 queued per experience,
eliminating the 200+ query serialization cost from the HTTP path.
Two broadcast paths remain synchronous: resubscribe_required
messages (extracted to broadcast_profile_changes) and the existing
broadcast_family_feud_update delta events.
Also replace the Thread.new { sleep 3 } in show_x with a proper
Minigames::ClearShowXJob.set(wait: 3.seconds) call.
Test adapter is now :test by default in specs and :inline for
system specs so BroadcastUpdateJob executes synchronously in
browser tests. Add a new segment_visibility_spec covering the
manual assign/remove resubscribe path end-to-end.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
JaredShay
force-pushed
the
segment-performance-improvements
branch
from
June 17, 2026 18:33
44b9e1f to
3da9bbc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace all synchronous broadcast_experience_update calls with a coalescing Sidekiq job (BroadcastUpdateJob) that uses sidekiq-unique-jobs lock: :until_executing per experience_id. This caps inflight work at 1 executing + 1 queued per experience, eliminating the 200+ query serialization cost from the HTTP path.
Two broadcast paths remain synchronous: resubscribe_required messages (extracted to broadcast_profile_changes) and the existing broadcast_family_feud_update delta events.
Also replace the Thread.new { sleep 3 } in show_x with a proper Minigames::ClearShowXJob.set(wait: 3.seconds) call.
Test adapter is now :test by default in specs and :inline for system specs so BroadcastUpdateJob executes synchronously in browser tests. Add a new segment_visibility_spec covering the manual assign/remove resubscribe path end-to-end.