Instance Method
requestConnection(logger:on:)
Requests a pooled connection.
func requestConnection(logger: Logger? = nil, on eventLoop: (any EventLoop)? = nil) -> EventLoopFuture<Source.Connection>
Parameters
loggerFor trace and debug logs.
eventLoopPreferred event loop for the new connection.
Return Value
A future containing the requested connection.
Discussion
The connection returned by this method should be released when you are finished using it.
let conn = try pool.requestConnection(...).wait()
defer { pool.releaseConnection(conn) }
// use the connection
See withConnection(logger:on:_:) for a callback-based method that automatically releases the connection.