Skip to content

refactor: small adjustments over WorkerInfo - #860

Merged
metcoder95 merged 2 commits into
currentfrom
refactor_workinfo
Jul 29, 2025
Merged

refactor: small adjustments over WorkerInfo#860
metcoder95 merged 2 commits into
currentfrom
refactor_workinfo

Conversation

@metcoder95

Copy link
Copy Markdown
Member

No description provided.

@metcoder95
metcoder95 requested a review from Copilot July 27, 2025 11:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 refactors the WorkerInfo class to improve its construction pattern and API design. The changes move from passing a pre-instantiated Worker to accepting worker configuration parameters, allowing the WorkerInfo class to manage Worker instantiation internally.

  • Refactored WorkerInfo constructor to accept worker configuration instead of Worker instance
  • Added new event handler methods to WorkerInfo for better encapsulation
  • Reorganized worker initialization flow in ThreadPool to use the new WorkerInfo API

Reviewed Changes

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

File Description
src/worker_pool/index.ts Refactored WorkerInfo constructor and added new event handler methods for Worker lifecycle management
src/index.ts Updated ThreadPool to use new WorkerInfo constructor pattern and reorganized worker initialization flow

Comment thread src/worker_pool/index.ts
Comment thread src/worker_pool/index.ts
Comment thread src/worker_pool/index.ts
Comment thread src/index.ts Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Carlos Fuentes <me@metcoder.dev>
@metcoder95 metcoder95 added the backport v5 Backport related with v5.x label Jul 29, 2025
@metcoder95
metcoder95 merged commit 48bf5fa into current Jul 29, 2025
17 of 19 checks passed
@metcoder95
metcoder95 deleted the refactor_workinfo branch July 29, 2025 08:14
github-actions Bot pushed a commit that referenced this pull request Jul 29, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
(cherry picked from commit 48bf5fa)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport v5 Backport related with v5.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants