vapor / async-kit

Sugary extensions for the SwiftNIO library
MIT License
71 stars 25 forks source link

connection pool #20

Closed tanner0101 closed 5 years ago

tanner0101 commented 5 years ago
tanner0101 commented 5 years ago

@calebkleveter thanks :) This PR is ready for merging. Given that it's a big change, we should probably have both maintainers approve. (cc @MrLotU)

calebkleveter commented 5 years ago

Hmm, I just noticed this. Is it a concern that the user could just add arbitrary connections?

https://github.com/vapor-community/nio-kit/pull/20/files#diff-7acdf3a1479b20f94aac093d926e2481R161

tanner0101 commented 5 years ago

Is it a concern that the user could just add arbitrary connections?

Do you mean add a connection to the pool that didn't come from it? In Vapor 3, there's a check for this actually but honestly I don't think the overhead is worth it. Most of the time the end user will not be using a pool directly, and even if they are, they usually use withConnection.

MrLotU commented 5 years ago

Hmm, I just noticed this. Is it a concern that the user could just add arbitrary connections?

Why would a user do this? It'll only break their app, right?

calebkleveter commented 5 years ago

@MrLotU People do strange things 😄 @tanner0101 Sounds good 👍