Skip to content

Share lazy job scheduling across dataloaders#5669

Merged
rmosolgo merged 1 commit into
rmosolgo:masterfrom
ydah:refactor-dataloader-lazy-jobs
Jul 15, 2026
Merged

Share lazy job scheduling across dataloaders#5669
rmosolgo merged 1 commit into
rmosolgo:masterfrom
ydah:refactor-dataloader-lazy-jobs

Conversation

@ydah

@ydah ydah commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

This refactors lazy job scheduling shared by Dataloader and AsyncDataloader.

  • Move selection and enqueueing of the next lazy depth into the base Dataloader
  • Use a block for implementation-specific Fiber/Task execution
  • Keep Async queue lifecycle management isolated in run_lazy_jobs
  • Remove duplicated code and stale TODOs

No behavior change is intended.

@rmosolgo

Copy link
Copy Markdown
Owner

Looks good to me!

In general I have become wary of passing blocks in GraphQL-Ruby's runtime methods, because of the performance overhead they add (like the memory footprint of the local binding). But if this turns out to be problem, we could probably replace the yield call with a method call like self.after_lazies(...), and then implement that method in one way or another in the two dataloader classes.

@rmosolgo rmosolgo added this to the 2.6.6 milestone Jul 15, 2026
@rmosolgo
rmosolgo merged commit 8b9f621 into rmosolgo:master Jul 15, 2026
12 of 13 checks passed
@ydah
ydah deleted the refactor-dataloader-lazy-jobs branch July 15, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants