-
Notifications
You must be signed in to change notification settings - Fork 354
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
feat: transaction batcher module #1348
feat: transaction batcher module #1348
Conversation
@samuelAndalon can you add copyright to all new source files? |
...ng-server/src/main/kotlin/com/expediagroup/graphql/server/spring/GraphQLAutoConfiguration.kt
Outdated
Show resolved
Hide resolved
.../src/main/kotlin/com/expediagroup/graphql/transactionbatcher/publisher/TriggeredPublisher.kt
Outdated
Show resolved
Hide resolved
.../src/main/kotlin/com/expediagroup/graphql/transactionbatcher/publisher/TriggeredPublisher.kt
Outdated
Show resolved
Hide resolved
...rc/main/kotlin/com/expediagroup/graphql/transactionbatcher/transaction/TransactionBatcher.kt
Outdated
Show resolved
Hide resolved
...er/src/test/kotlin/com/expediagroup/graphql/transactionbatcher/publisher/AstronautService.kt
Show resolved
Hide resolved
.../src/main/kotlin/com/expediagroup/graphql/transactionbatcher/publisher/TriggeredPublisher.kt
Outdated
Show resolved
Hide resolved
… into feat/transaction-batcher
* Interface representing a publisher with input [TInput] type and output [TOutput] type | ||
*/ | ||
@Suppress( | ||
"ReactiveStreamsSubscriberImplementation", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we suppressing this warning? is this valid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is valid, given that Subscriber
is an interface, so it's valid to implement it, However a warning appears in the IDE when trying to do it.
i can see a lot of Subscriber
implementations that need to add that suppress as well
https://github.com/search?p=2&q=%22ReactiveStreamsSubscriberImplementation%22&type=Code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unsure, I am not getting any warning in my local
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.../src/main/kotlin/com/expediagroup/graphql/transactionbatcher/publisher/TriggeredPublisher.kt
Outdated
Show resolved
Hide resolved
.../src/main/kotlin/com/expediagroup/graphql/transactionbatcher/publisher/TriggeredPublisher.kt
Outdated
Show resolved
Hide resolved
...in/com/expediagroup/graphql/transactionbatcher/transaction/DefaultTransactionBatcherCache.kt
Outdated
Show resolved
Hide resolved
...rc/main/kotlin/com/expediagroup/graphql/transactionbatcher/transaction/TransactionBatcher.kt
Outdated
Show resolved
Hide resolved
Why does this use reactive-streams instead of kotlinx-coroutines Flow? Flow can be transformed to reactive-streams by users, if desired. |
We decided to use generic reactive streams |
reactive streams and all his implementations like project-reactor have 100% interoperability with other async technologies like Java Flow, coroutines, completableFuture etc. |
Ok. Given this is a Kotlin project, I would have thought coroutines Flow would be the obvious choice as first-party implementation. As stated, it is easy to convert from Flow to other reactive streams implementations i.e. Is there any documentation in the works for this feature? Seems really interesting. |
Once we add the instrumentation that will signal when to dispatch, we will add the documentation. for now you can refer to the unit tests |
### 📝 Description `transaction-batcher` module is an alternative to `data-loaders`, using reactive stream to apply batching and deduplication of transactions needed by data fetchers, the implementation is completely agnostic of GraphQL and compatible with any asynchronous approach used to resolve data. it also supports caching to avoid making a request to a previous completed transaction.
📝 Description
transaction-batcher
module is an alternative todata-loaders
, using reactive stream to apply batching and deduplication of transactions needed by data fetchers, the implementation is completely agnostic of GraphQL and compatible with any asynchronous approach used to resolve data.it also supports caching to avoid making a request to a previous completed transaction.
🔗 Related Issues