Skip to content

refactor: move idle container implementations into internal/idle package - #93

Merged
Yiming1997 merged 1 commit into
mainfrom
chore/move-idle-to-directory
Sep 1, 2026
Merged

Yiming1997 merged 1 commit into
mainfrom
chore/move-idle-to-directory

Conversation

@Yiming1997

Copy link
Copy Markdown
Owner

Move all idle_*.go files into a new internal/idle package, converting the container types to generics to break the import cycle with the root package:

  • internal/idle now hosts the IdleContainer[T] interface, the IdleContainerType enum, and generic implementations: LinkedList, MinHeap, Slice, RingQueue, Treap
  • worker implements the new Dated interface (DatedTime()) required by the containers
  • Pool now holds an idle.IdleContainer[*worker] and constructs containers via the generic constructors
  • public API preserved: IdleContainerType and the LinkedListType/MinHeapType/etc. constants are re-exported from the root package via type alias

Also:

  • move idle container unit tests into internal/idle with a testWorker helper
  • move Pool+RingQueue integration tests to pool_ringqueue_test.go
  • move TestTaskQueueSizeConfiguresHandoffCapacity into pool_test.go and add the GetTaskQueueCapacity() getter to support external-package testing
  • delete the old idle_*.go files from the root directory

Move all idle_*.go files into a new internal/idle package, converting the
container types to generics to break the import cycle with the root package:

- internal/idle now hosts the IdleContainer[T] interface, the IdleContainerType
  enum, and generic implementations: LinkedList, MinHeap, Slice, RingQueue, Treap
- worker implements the new Dated interface (DatedTime()) required by the containers
- Pool now holds an idle.IdleContainer[*worker] and constructs containers via the
  generic constructors
- public API preserved: IdleContainerType and the LinkedListType/MinHeapType/etc.
  constants are re-exported from the root package via type alias

Also:
- move idle container unit tests into internal/idle with a testWorker helper
- move Pool+RingQueue integration tests to pool_ringqueue_test.go
- move TestTaskQueueSizeConfiguresHandoffCapacity into pool_test.go and add the
  GetTaskQueueCapacity() getter to support external-package testing
- delete the old idle_*.go files from the root directory
@Yiming1997
Yiming1997 merged commit fa7823f into main Sep 1, 2026
1 check passed
@Yiming1997
Yiming1997 deleted the chore/move-idle-to-directory branch September 1, 2026 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant