puddle icon indicating copy to clipboard operation
puddle copied to clipboard

Generic resource pool for Go

Results 6 puddle issues
Sort by recently updated
recently updated
newest added

Hi. pool.go ``` func (p *Pool) Acquire(ctx context.Context) (*Resource, error) { ... **p.allResources** = append(p.allResources, res) **p.destructWG.Add(1)** p.cond.L.Unlock() value, err := p.constructResourceValue(ctx) p.cond.L.Lock() if err != nil { p.allResources =...

This PR is a rework of #29. No extra dependencies are added, no dependency updates are performed. These changes do not break backward compatibility, external observer is optional and must...

Since #35 merged, it seems the only usage of `unsafe` in this library is in log.go's `log2Int` function. That function is unexported and uses generics but is only called in...

Was reading #30 and thought the [tracing idea](https://github.com/jackc/puddle/pull/30#issuecomment-1848594725) sounded interesting, so I thought I'd do a quick WIP of the idea to play around with the technique and maybe use...

**Description**: As described in issue #25, my application hangs on the statement `defer p.destructWG.Wait()`. Any deferred statement or code that should execute after `defer pool.Close()` does not run. This issue...