Skip to content

Conversation

@andimarek
Copy link
Member

This is port of the concept of a dispatch strategy from GraphQL Java to DataLoader itself.

It allows DataLoader to be used with an automatic dispatch strategy.

One DispatchStrategy which is based on the concept of being busy or not, is provided.

import org.jspecify.annotations.NullMarked;

@NullMarked
@PublicApi
Copy link
Member

Choose a reason for hiding this comment

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

Is an SPI right? We would expect people to implement it?

Copy link
Member

Choose a reason for hiding this comment

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

@PublicSPI

CompletableFuture<V> result = loadImpl(key, keyContext);
options.getDispatchStrategy().loadCalled(this);
return result;
}
Copy link
Member

Choose a reason for hiding this comment

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

I feel like this should be in DataLoaderHelper which is really the guts of the code

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