blob: 9eb6f0fa191300590953a56f55f1c3517783d8c4 (
about) (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
package commitquery
import (
"sync"
commitgraphread "codeberg.org/lindenii/furgit/format/commitgraph/read"
objectstore "codeberg.org/lindenii/furgit/object/store"
)
// Queries provides commit-domain queries over one object store
// and optional commit-graph reader.
//
// Queries reuses internal mutable query workers across operations.
//
// Labels: MT-Safe.
type Queries struct {
store objectstore.ReadingStore
graph *commitgraphread.Reader
mu sync.Mutex
idle []*query
maxIdle int
}
// TODO: Research a shared arena, or perhaps worker-reconciliation
// schemes if a complete shared arena proves to be too contentious.
|