Classes

The following classes are available globally.

  • Holds a collection of active DatabaseConnections that can be requested and later released back into the pool. New connections are created as needed when a connection is requested and none are available until the max limit is reached. After the maximum is reached, no new connections will be created unless existing, active connections become closed.

    let conn = try pool.requestConnection().wait()
    defer { pool.releaseConnection(conn) }
    // use the connection
    

    Normally you will not use this type directly and you will use methods like Container.withPooledConnection(...) instead.

    See more

    Declaration

    Swift

    public final class DatabaseConnectionPool<Database> where Database : Database
  • In-memory, thread safe KeyedCache implementation.

    Warning

    This implementation uses locks and is meant for testing and development. Use a service like Redis or Memcached instead. This class is not suitable for production.

    See DictionaryKeyedCache for a non-threadsafe implementation.

    See more

    Declaration

    Swift

    public final class MemoryKeyedCache : KeyedCache, Service