lo
lo copied to clipboard
BufferWithTimeout Should accept a context and support context cancellation
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?