Skip to content

Instance Property

threadPool

The application thread pool. Vapor uses NIOSingletons.posixBlockingThreadPool by default for this, which defaults to a thread pool of size equal to the number of available cores.
var threadPool: NIOThreadPool { get set }

Discussion

It’s possible to configure the thread pool size by overriding this value with your own thread pool.

application.threadPool = NIOThreadPool(numberOfThreads: 100)

If overridden, Vapor will take ownership of the thread pool and automatically start it and shut it down when needed.

Warning

Can only be set during application setup/initialization.