Skip to content

refactor(worker): pass IsolatePool as injected dependency#1946

Merged
LNSD merged 1 commit intomainfrom
refactor-worker-pass-isolate-pool-dep
Mar 10, 2026
Merged

refactor(worker): pass IsolatePool as injected dependency#1946
LNSD merged 1 commit intomainfrom
refactor-worker-pass-isolate-pool-dep

Conversation

@LNSD
Copy link
Contributor

@LNSD LNSD commented Mar 10, 2026

Align IsolatePool lifecycle with the established dependency injection pattern where shared resources are created at binary entry points and propagated through service contexts.

  • Remove IsolatePool::new() from exec_env::create() and accept it as a parameter
  • Create IsolatePool at ampd command entry points (server, worker, solo)
  • Thread pool through server::service, flight::Service, and WorkerJobCtx
  • Add isolate_pool field to derived dataset Context for job execution

@LNSD LNSD requested a review from shiyasmohd March 10, 2026 11:30
@LNSD LNSD self-assigned this Mar 10, 2026
@LNSD
Copy link
Contributor Author

LNSD commented Mar 10, 2026

This is another spin-off from #1900

Copy link
Member

@Theodus Theodus left a comment

Choose a reason for hiding this comment

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

LGTM, just seems like there were some misplaced comments during the refactor.

@LNSD LNSD force-pushed the refactor-worker-pass-isolate-pool-dep branch from 28a4e36 to 8280f43 Compare March 10, 2026 11:53
Copy link
Contributor

@shiyasmohd shiyasmohd left a comment

Choose a reason for hiding this comment

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

LGTM. Added suggestions in comments.

Align IsolatePool lifecycle with the established dependency injection pattern where shared resources are created at binary entry points and propagated through service contexts.

- Remove `IsolatePool::new()` from `exec_env::create()` and accept it as a parameter
- Create `IsolatePool` at `ampd` command entry points (server, worker, solo)
- Thread pool through `server::service`, `flight::Service`, and `WorkerJobCtx`
- Add `isolate_pool` field to derived dataset `Context` for job execution

Signed-off-by: Lorenzo Delgado <lorenzo@edgeandnode.com>
@LNSD LNSD force-pushed the refactor-worker-pass-isolate-pool-dep branch from 8280f43 to b35260b Compare March 10, 2026 12:02
@LNSD LNSD merged commit 96e2374 into main Mar 10, 2026
8 checks passed
@LNSD LNSD deleted the refactor-worker-pass-isolate-pool-dep branch March 10, 2026 12:05
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.

3 participants