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

AcquireWithin should take a context.Context #4

Closed
kevinburke opened this issue Apr 26, 2017 · 3 comments
Closed

AcquireWithin should take a context.Context #4

kevinburke opened this issue Apr 26, 2017 · 3 comments

Comments

@kevinburke
Copy link

It would be easy enough to wait for either ctx.Done() or for a resource to become available.

@abiosoft
Copy link
Owner

This was written long before the context package. I plan to refactor it to take a context.

@abiosoft
Copy link
Owner

abiosoft commented Apr 29, 2017

I'm thinking of adding AcquireContext.

@abiosoft
Copy link
Owner

Now there is AcquireContext and you can use a context.WithCancel if required. https://godoc.org/github.com/abiosoft/semaphore#Semaphore.AcquireContext.

AcquireWithin has also been modified to simply use a context.WithTimeout.

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

No branches or pull requests

2 participants