[chore]: Bump codeberg.org/gruf/go-structr from 0.7.0 to 0.8.0 (#2902)

Bumps codeberg.org/gruf/go-structr from 0.7.0 to 0.8.0.

---
updated-dependencies:
- dependency-name: codeberg.org/gruf/go-structr
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
dependabot[bot]
2024-05-06 08:51:06 +00:00
committed by GitHub
parent a5f28fe0c9
commit 8237e8d09e
6 changed files with 58 additions and 4 deletions

View File

@ -64,6 +64,24 @@ func (q *QueueCtx[T]) Wait() <-chan struct{} {
return ctx
}
// Debug returns debug stats about queue.
func (q *QueueCtx[T]) Debug() map[string]any {
m := make(map[string]any)
q.mutex.Lock()
m["queue"] = q.queue.len
indices := make(map[string]any)
m["indices"] = indices
for i := range q.indices {
var n uint64
for _, list := range q.indices[i].data {
n += uint64(list.len)
}
indices[q.indices[i].name] = n
}
q.mutex.Unlock()
return m
}
func (q *QueueCtx[T]) pop(ctx context.Context, next func() *list_elem) (T, bool) {
if next == nil {
panic("nil fn")