Skip to content

Class

EventLoopConnectionPool

Holds a collection of active connections that can be requested and later released back into the pool.
final class EventLoopConnectionPool<Source> where Source : ConnectionPoolSource

Overview

Connection pools are used to offset the overhead of creating new connections. Newly opened connections are returned back to the pool and can be re-used until they close.

New connections are created as needed until the maximum configured connection limit is reached. After the maximum is reached, no new connections will be created unless existing connections are closed.

let pool = EventLoopConnectionPool(...)
pool.withConnection(...) { conn in
    // use conn
}

Topics

Initializers

Instance Properties

Instance Methods

See Also

Legacy connection pools