Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transform support for DataLoaders #174

Merged
merged 1 commit into from
Jan 20, 2025
Merged

Transform support for DataLoaders #174

merged 1 commit into from
Jan 20, 2025

Conversation

bbakerman
Copy link
Member

This adds support for a builder pattern in DataLoaders

The idea is so we can "transform" and existing dataloader and change its values

        DataLoader<String, Object> dataLoader2 = dataLoader1.transform(it -> {
            it.options(differentOptions);
            it.batchLoadFunction(batchLoader2);
        });

This PR is a setup PR to allow for "instrumentation" of DataLoaders. The Spring team have asked for this to allow them to "time" the batch load functions etc.. and they might not have built the data loaders at request time

This PR is small pre-req to that

return this;
}

DataLoader<K, V> build() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feck - missed the public bit here - will fix in another PR

@bbakerman bbakerman merged commit 2036771 into master Jan 20, 2025
1 check passed
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