-
Notifications
You must be signed in to change notification settings - Fork 30
Simplify lifetime management #347
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
Conversation
0066ed8
to
935af81
Compare
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.
Pull Request Overview
This PR simplifies lifetime management in the kRPC protocol by removing the complex inheritance hierarchy and related fields. Key changes include:
- Eliminating inheritance from CoroutineScope in RpcServer and RpcClient while updating the service factory signatures.
- Deprecating and removing the RemoteService interface along with its coroutineContext-related properties.
- Removing support code that auto-injects RemoteService as a supertype, including associated compiler plugin components.
Reviewed Changes
Copilot reviewed 193 out of 193 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
core/src/commonMain/kotlin/kotlinx/rpc/annotations/Rpc.kt | Removed explicit RemoteService inheritance from annotated interfaces and updated sample code. |
core/src/commonMain/kotlinx/rpc/RpcServer.kt | Changed serviceFactory signature and removed CoroutineScope inheritance; documentation remains outdated. |
core/src/commonMain/kotlinx/rpc/RpcClient.kt | Removed CoroutineScope and Deferred usage; documentation still refers to CoroutineScope lifetime. |
core/src/commonMain/kotlinx/rpc/RemoteService.kt | Deprecated the RemoteService interface and removed its CoroutineScope dependency. |
core/api/core.api | Updated API definitions to reflect removed coroutine context parameters. |
Compiler plugin files | Removed several supertype generator files and updated diagnostic messages and checkers accordingly. |
compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RpcStubGenerator.kt | Removed coroutineContext property generation from RPC stub code. |
Remaining compiler-plugin files | Adjusted references to removed properties and methods related to lifetime/coroutineContext. |
Comments suppressed due to low confidence (2)
core/src/commonMain/kotlin/kotlinx/rpc/RpcServer.kt:14
- The documentation comment still mentions [CoroutineScope] defines server lifetime, but RpcServer no longer extends CoroutineScope. Please update the comment to reflect the current lifetime management approach.
* Server may contain multiple services. [CoroutineScope] defines server lifetime.
core/src/commonMain/kotlin/kotlinx/rpc/RpcClient.kt:17
- The documentation comment for RpcClient still refers to CoroutineScope for defining its lifetime, but the interface no longer extends CoroutineScope. Please update the comment accordingly.
* [CoroutineScope] defines the lifetime of the client.
126ec96
to
d9dc982
Compare
- Remove too old versions - Add dumps for 0.8.0
Strict mode Migration
A series of changes to simplify kRPC protocol
Subsystem
kRPC
Problem Description
Lifetimes now have a hierarchy. We decided to abandon this approach.
Solution
Remove complex hierarchy of requests.
One of the side effects: