Skip to content

Add Async::Scheduler.enable_worker_pool and .worker_pool= - #479

Open
ekmartin wants to merge 1 commit into
socketry:mainfrom
ekmartin:ek-conductor/async-scheduler-worker_pool-enable
Open

ekmartin wants to merge 1 commit into
socketry:mainfrom
ekmartin:ek-conductor/async-scheduler-worker_pool-enable

Conversation

@ekmartin

@ekmartin ekmartin commented Oct 9, 2026 •

Copy link
Copy Markdown

Summary

@ioquatix Do you think this makes sense? It was just a little clunky having to set the environment variable but we can also just wrap everything with our own reactor on our end if you don't think this is worth adding, that's completely fine too if you'd prefer keeping the surface smaller.


        Fiber.blocking do
          reactor = Async::Reactor.new(worker_pool: true)
          begin
            reactor.run(finished: false) { blk.call }.wait
          ensure
            Fiber.set_scheduler(nil)
          end
        end

Contribution

…igure the worker pool at runtime.

Schedulers created without an explicit `worker_pool:` argument, including those created by `Sync`, `Async` and `Async::Reactor.new`, use the configured factory to create their own worker pool. The `ASYNC_SCHEDULER_WORKER_POOL` environment variable is still supported and enables the default worker pool.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
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