Skip to content

Conversation

Jozott00
Copy link
Collaborator

Subsystem
gRPC

Problem Description
A main feature of all gRPC libraries is their interceptor API.
We want a Kotlin idiomatic simple-to-use interceptor API (for client and server) that allows users to implement things like authentication, logging or tracing.

Solution
This PR adds a convenient Kotlin idiomatic interceptor API.

@Jozott00 Jozott00 self-assigned this Sep 18, 2025
@Jozott00 Jozott00 added the feature New feature or request label Sep 18, 2025
@Jozott00 Jozott00 requested a review from Mr3zee September 18, 2025 13:31
@Jozott00 Jozott00 marked this pull request as ready for review September 18, 2025 13:31
Signed-off-by: Johannes Zottele <[email protected]>
Signed-off-by: Johannes Zottele <[email protected]>
Signed-off-by: Johannes Zottele <[email protected]>
Signed-off-by: Johannes Zottele <[email protected]>
Signed-off-by: Johannes Zottele <[email protected]>
Signed-off-by: Johannes Zottele <[email protected]>
Signed-off-by: Johannes Zottele <[email protected]>
Copy link
Member

@Mr3zee Mr3zee left a comment

Choose a reason for hiding this comment

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

Great work! I have some comments nitpicking some details, mostly DSL, but everything else is well designed

and btw kDocs are really good there, quite easy to read and understand

@Jozott00 Jozott00 requested a review from Mr3zee September 19, 2025 17:45
Copy link
Member

@Mr3zee Mr3zee left a comment

Choose a reason for hiding this comment

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

Great, thank you!

Comment on lines +254 to +255


Copy link
Member

Choose a reason for hiding this comment

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

Please leave only one empty line in between declarations, same in some other places

Comment on lines +311 to +312
* registerService(MyService())
* registerService(MyOtherService())
Copy link
Member

Choose a reason for hiding this comment

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

This is a bit wrong example, should be:

registerService<MyService> { MyServiceImple() } 

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Upsi

Comment on lines +215 to +217
* registerService(MyService())
* registerService(MyOtherService())
* }
Copy link
Member

Choose a reason for hiding this comment

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

Same here

) { client, descriptor ->
val response = client.clientStreamingRpc(descriptor, flow {
repeat(5) {
delay(100)
Copy link
Member

Choose a reason for hiding this comment

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

Please remove delay from tests, replace with completable deferred

@morki
Copy link

morki commented Sep 22, 2025

Will there be an interceptor feature in KRPC too? It would be really handy for the same use cases as presented here.

@Mr3zee
Copy link
Member

Mr3zee commented Sep 22, 2025

@morki in some sort, yes, though later, we only maintain kRPC now, until we finish with gRPC (which is not much else to do, but still will take a couple of months)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants