Add configurable thread pool and virtual thread support#8
Merged
Conversation
- Expose :min-threads, :max-threads, :max-queue-size as optional service config keys - Build QueuedThreadPool with BlockingArrayQueue for bounded backpressure on Java < 21 - Auto-detect Java 21+ and use VirtualThreadPool for higher throughput with less memory - Add :use-virtual-threads config flag to opt out (defaults to true) - Add integration tests for default and custom thread pool configuration Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Fix :idle-timeout-ms being silently ignored (wrong Pedestal key); now applied via container-options configurator on all connectors - Fix thread pool also silently ignored; now passed via container-options - Add virtual-threads-enabled-by-default-test and virtual-threads-disabled-test asserting Thread.currentThread().isVirtual() from inside live handlers Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Upgrade CI from Java 17 to Java 21 — required for virtual thread support (Thread.isVirtual() does not exist on Java 17, causing 500s in tests) - Replace Thread.isVirtual() with class name check to avoid NoSuchMethodError on pre-21 JVMs and GraalVM reflection restrictions Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
:min-threads,:max-threads,:max-queue-sizeas optional[:config :service]keys with sane defaults (8/50/200)QueuedThreadPoolwithBlockingArrayQueuefor bounded backpressure on Java < 21 — requests beyond queue capacity are rejected instead of silently filling heapVirtualThreadPoolfor higher throughput at lower memory cost:use-virtual-threadsconfig flag to opt out (defaults totrue)Test plan
lein test— all 11 tests pass🤖 Generated with Claude Code