Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow PostgresConnection creation without specifying an EventLoop #388

Closed
2 tasks
fabianfett opened this issue Aug 8, 2023 · 0 comments · Fixed by #389
Closed
2 tasks

Allow PostgresConnection creation without specifying an EventLoop #388

fabianfett opened this issue Aug 8, 2023 · 0 comments · Fixed by #389
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@fabianfett
Copy link
Collaborator

fabianfett commented Aug 8, 2023

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant