Closed sgrif closed 7 years ago
Sounds good to me! I think the name try_get
matches up a bit more with things like the stdlib Mutex though.
Thanks!
@sgrif I noticed that when #32 was rebased over this try_get
calls establish_idle_connections
. What are the intended semantics with respect to new connection creation?
I'd expect try_get
to cause idle connections to be opened if needed -- Since establish_idle_connections
shouldn't block for any significant amount of time, I don't think it's an issue
Ok, but not go above min_idle (like we do in https://github.com/sfackler/r2d2/blob/master/src/lib.rs#L419-L421)?
This method behaves the same as
get
, except that it will not attempt to establish new connections, and will not wait for a connection to become available. This is useful for users who may wish to attempt to parallelize a task over multiple connections, but only if there are enough idle connections already available.