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

Add support for a drop-in replacement for sync.Mutex and sync.RWMutex #3

Open
michaelfinch opened this issue Feb 7, 2018 · 5 comments
Labels
enhancement New feature or request

Comments

@michaelfinch
Copy link
Member

Per the discussion in #2, it would be nice to have client(s) that implement the same methods as sync.Mutex and sync.RWMutex

@smartinov
Copy link

Think I'll have a look at it over the weekend, possibly make a pull request!

Any special guidelines i should adhere?

@michaelfinch
Copy link
Member Author

Hey @smartinov. So after thinking about this more, I don't think it makes sense to include this functionality in this package right now. Currently the package does one very specific thing - it provides a mongo client capable of creating basic lock primitives - and I would like to try and keep it that way. Imo the best way to do what you want is, as you've already done, implement your own small wrapper around a lock.Client within your code. I'm not opposed to potentially changing the client methods, but I don't want to create additional clients here.

@smartinov
Copy link

Hi! Sure, no problem! Makes sense!

Maybe it would be good to extend it with something like NewClient but to optionally allow ensuring indexes automatically, by using something like sync.Once or something?

How's that sound?

@michaelfinch
Copy link
Member Author

michaelfinch commented Feb 9, 2018

I like that. Let's add a CreateIndexes method to the client that creates all of the indexes described in the README. Feel free to add it, or else I will next week.

@smartinov
Copy link

#4 Implements the CreateIndexes Method

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

No branches or pull requests

2 participants