b9c4e17291
Motivation: SimpleChannelPool provides ability to provide custom callbacks/handlers on major events such as "channel acquired", "channel created" and "channel released". In the current implementation, when a request to acquire a channel is made for the first time, the internal channel pool creates the channel lazily. This triggers the "channel created" callback but does not invoke the "channel acquired" callback. This is contrary to caller expectations who assumes that "channel acquired" will be invoked at the end of every successful acquire call. It also leads to an inconsistent API experience where the acquired callback is sometimes invoked and sometimes it isn't depending on wheather the internal mechanism is creating a new channel or re-using an existing one. Modifications: Invoke acquired callback consistenly even when creating a new channel and modify the tests to support this behaviour Result: Consistent experience for the caller of acquire API. Every time they call the API, the acquired callback will be invoked. |
||
---|---|---|
.. | ||
src | ||
pom.xml |