Skip to content

Allow PostgresConnection creation without specifying an EventLoop #388

Closed
@fabianfett

Description

@fabianfett

SwiftNIO has landed EventLoopGroup singletons in 2.58.0. See apple/swift-nio#2471.

We should add an additional PostgresConnection connect method, that internally uses the existing one, but uses the NIO singleton:

extension PostgresConnection {
    static func connect(
        configuration: PostgresConnection.Configuration,
        id connectionID: PostgresConnection.ID,
        logger: Logger
    ) async throws -> PostgresConnection {
        try await Self.connect(
            on: MultiThreadedEventLoopGroup.singleton.any(),
            configuration: configuration,
            id: connectionID,
            logger: logger
        )
    }
}
  • Add API
  • Remove all EventLoopGroup usages in the README

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions