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

made Pool an interface (pool) #6

Merged
merged 4 commits into from
Sep 13, 2015

Conversation

JavierZunzunegui
Copy link
Contributor

As it stands having Mutex.nodes as a struct array ([]*redis.Pool) limits the use of this library as it can't be adapted to our more specific pools.

@hjr265
Copy link
Owner

hjr265 commented Sep 8, 2015

Hi Javier,

Thanks for creating this pull request.

I might be missing something here, but does reducing the Pool type's visibility help here? I think it kind of makes the NewMutexWithPool func unusable from other packages.

https://github.com/golang/go/wiki/InterfaceSlice

So []*redis.Pool will not satisfy that argument's type, since it expects an array of a particular interface. Unless it is possible to construct an array of redsync.Pool from other packages, there won't be much use for NewMutexWithPool func.

It may be a good idea to create a separate func for this as others may already be relying on the current ones and I do not want to abruptly break compatibility for them.

Best regards,
Ridwan

@JavierZunzunegui
Copy link
Contributor Author

Hi Ridwan,
Just noticed what your point, reverted my visibility changes. Also will commit in a minute a different NewMutexWithPool that maintains backwards compatibility.

hjr265 added a commit that referenced this pull request Sep 13, 2015
@hjr265 hjr265 merged commit 099d3c3 into hjr265:master Sep 13, 2015
@hjr265
Copy link
Owner

hjr265 commented Sep 13, 2015

@JavierZunzunegui Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants