mediocregopher / radix.v2

Redis client for Go
http://godoc.org/github.com/mediocregopher/radix.v2
MIT License
433 stars 92 forks source link

[Pool] Return full pool #43

Closed eloycoto closed 7 years ago

eloycoto commented 7 years ago

Hi,

For debugging purposes we want to have access to the Pool.pool field. It's too useful to know how many pools are in the channel and how many are in use.

Is a unexportable field, so it's impossible to access to the pool without this method.

Regards.

mediocregopher commented 7 years ago

Hey there! I'm not super comfortable just outright returning the channel itself like you're doing in your PR, that exposes an implementation detail that really ought not to be exposed. It'd safer to just make it an Avail method or something along those lines that simple returns how elements are currently buffered in the channel.

Thanks for the PR though!

eloycoto commented 7 years ago

Hey @mediocregopher

I've just updated the PR. The Avail method will be too helpful for us.

Thanks

mediocregopher commented 7 years ago

Merged, thanks!

eloycoto commented 7 years ago

Many thanks!