Skip to content

Conversation

@scottmarchant
Copy link
Collaborator

@scottmarchant scottmarchant commented Dec 2, 2025

Summary

Implements a Swift concurrency-backed NIOThreadPool.

Details

  • 2ad8fc4 feat: Implement NIOThreadPool using swift concurrency

Usage Examples

  • Start a pool and run work if still active:
let pool = NIOThreadPool(numberOfThreads: 1)
pool.start()
defer { try await pool.shutdownGracefully() }
try await pool.runIfActive {
  // work executed on a pool thread
}
  • Submit work bound to an event loop:
let pool = NIOThreadPool(numberOfThreads: 1)
pool.start()
let eventLoop = MultiThreadedEventLoopGroup(numberOfThreads: 1).next()
let future: EventLoopFuture<String> = pool.runIfActive(eventLoop: eventLoop) { "done" }
let result = try await future.get()
try await pool.shutdownGracefully()

Testing Performed

Tests coverage provided in tests ported from NIOPosix: #9.

The changes have also been tested in real-world application by running GraphManager and QuantumProjectManager in the browser to migrate database schemas, connect with our server, and pull data from a real user account.

PR Dependencies

#5

Overview of all changes

All planned changes can be viewed together in #2

@scottmarchant scottmarchant changed the title Implement concurrency-backed NIOThreadPool feat: Implement concurrency-backed NIOThreadPool Dec 2, 2025
@scottmarchant scottmarchant force-pushed the build/setUpInitialPackageAndCI branch from d7f5ff7 to 5f6892f Compare December 2, 2025 17:54
@scottmarchant scottmarchant force-pushed the feat/implementNIOThreadPool branch from 2ad8fc4 to 100dd09 Compare December 2, 2025 18:24
@scottmarchant scottmarchant changed the base branch from build/setUpInitialPackageAndCI to chore/addTestUtils December 2, 2025 20:03
@scottmarchant scottmarchant self-assigned this Dec 2, 2025
@scottmarchant scottmarchant marked this pull request as ready for review December 2, 2025 20:20
@scottmarchant scottmarchant force-pushed the feat/implementNIOThreadPool branch from 100dd09 to 28b5f04 Compare December 3, 2025 21:08
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.

4 participants