lo icon indicating copy to clipboard operation
lo copied to clipboard

BufferWithTimeout Should accept a context and support context cancellation

Open tonyalaribe opened this issue 1 year ago • 0 comments

https://pkg.go.dev/github.com/samber/lo#BufferWithTimeout

I'm using BufferWithTimeout, and found that it makes graceful shutdown/cleanups difficult, since I can't use a select to select on the channel and also wait for a context cancelation.

I imagine this is a common usecase, since there usually needs to be a way to break out of listening on a channel. What do you think? Should I create a PR?

tonyalaribe avatar Jun 08 '23 18:06 tonyalaribe