public final class Application
Core type representing a Vapor application.
public let eventLoopGroupProvider: EventLoopGroupProvider
public let eventLoopGroup: EventLoopGroup
public private(set) var didShutdown: Bool
public var logger: Logger
public var lifecycle: Lifecycle
public var locks: Locks
public var sync: Lock
public var caches: Caches
Controls application's configured caches.
public var cache: Cache
Current application cache. See
Request.cache for caching in request handlers.
public var clients: Clients
public var console: Console
public var commands: Commands
public var threadPool: NIOThreadPool
The application thread pool. Vapor provides a thread pool with 64 threads by default.
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.
public var fileio: NonBlockingFileIO
public var allocator: ByteBufferAllocator
public var running: Running?
public var http: HTTP
public var password: Password
public var passwords: Passwords
public var servers: Servers
public var sessions: Sessions
public var views: Views
public func run() throws
Starts the Application using the
start() method, then waits for any running tasks to complete
If your application is started without arguments, the default argument is used.
Under normal circumstances,
run() begin start the shutdown, then wait for the web server to (manually) shut down before returning.
public func start() throws
When called, this will execute the startup command provided through an argument. If no startup command is provided, the default is used. Under normal circumstances, this will start running Vapor's webserver.
start Vapor through this method, you'll need to prevent your Swift Executable from closing yourself.
If you want to run your Application indefinitely, or until your code shuts the application down, use
public func boot() throws
public func shutdown()