Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(container/gring): add generic ring feature#4496

Merged
hailaz merged 8 commits intomasterfrom
feat/t_ring
Nov 28, 2025
Merged

feat(container/gring): add generic ring feature#4496
hailaz merged 8 commits intomasterfrom
feat/t_ring

Conversation

@joy999
Copy link
Contributor

@joy999 joy999 commented Oct 26, 2025

add TRing

@joy999 joy999 requested a review from Copilot October 26, 2025 06:07
@joy999 joy999 added the feature label Oct 26, 2025
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.

Pull Request Overview

This PR introduces a generic ring data structure (TRing[T]) to the container/gring package and refactors the existing deprecated Ring type to use it internally. The implementation provides type-safe ring buffer operations while maintaining backward compatibility.

Key changes:

  • Added TRing[T], a generic ring structure with thread-safe operations for any type
  • Refactored deprecated Ring to wrap TRing[any], eliminating code duplication
  • Created type alias internalRingItem pointing to internalTRingItem[any] for consistency

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
container/gring/gring_t.go Implements the new generic TRing[T] structure with all ring operations (set, get, move, link, unlink, iterate)
container/gring/gring.go Refactors deprecated Ring to use TRing[any] as embedded field, delegating all operations to the generic implementation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@joy999 joy999 requested a review from Copilot October 26, 2025 06:38
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.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hailaz hailaz merged commit ac75026 into master Nov 28, 2025
20 checks passed
@hailaz hailaz deleted the feat/t_ring branch November 28, 2025 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants