Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.

Conversation

@twisti-dev
Copy link
Contributor

This pull request includes several changes to the surf-cloud-api and surf-cloud-core projects, focusing on simplifying annotations, improving data classes, and cleaning up imports and coroutine usage. Below are the most important changes:

Simplification of Annotations:

  • Removed unnecessary methods from the SurfNettyPacketHandler annotation class in surf-cloud-api-common.api.
  • Simplified the SurfNettyPacketHandler annotation by removing AliasFor and KClass imports and their associated properties in SurfNettyPacketHandler.kt. [1] [2]

Data Class Improvements:

  • Changed NettyPacketInfo from a value class to a data class to improve data handling and provide additional functionality in NettyPacketInfo.kt.

Import Cleanup:

  • Removed unused imports in NettyListenerRegistry.kt to streamline the file.
  • Cleaned up imports in RegisteredListener.kt to remove unnecessary dependencies.

Coroutine Usage:

  • Simplified the coroutine handling in the handle method of RegisteredListener by removing withContext(Dispatchers.IO) and directly handling the invoker type. [1] [2]

@twisti-dev twisti-dev requested a review from Copilot April 8, 2025 20:34
@twisti-dev twisti-dev linked an issue Apr 8, 2025 that may be closed by this pull request
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Files not reviewed (1)
  • surf-cloud-api/surf-cloud-api-common/api/surf-cloud-api-common.api: Language not supported
Comments suppressed due to low confidence (1)

surf-cloud-core/surf-cloud-core-common/src/main/kotlin/dev/slne/surf/cloud/core/common/netty/registry/listener/RegisteredListener.kt:50

  • Removing withContext(Dispatchers.IO) changes the execution context of handle; please ensure that invoker implementations avoid blocking operations on the caller's thread.
suspend fun handle(packet: NettyPacket, info: NettyPacketInfo) = when (invokerType) {

@twisti-dev twisti-dev merged commit 539d8fe into master Apr 8, 2025
@twisti-dev twisti-dev deleted the 19-improve-packet-listener-performance branch April 8, 2025 20:41
@twisti-dev twisti-dev self-assigned this Apr 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Packet Listener Performance

2 participants