package qidpool
import "aqwari.net/net/styx/internal/qidpool"
Package qidpool manages pools of 9P Qids, 13-bit unique identifiers for files.
Index ¶
Types ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
A Pool maintains a pool of unique 13-bit identifiers for files on a 9P file server. A Pool must be created with a call to New.
func New ¶
func New() *Pool
New returns a new, empty Pool.
func (*Pool) Del ¶
Del removes a Qid from a Pool. Once a Qid is removed from a pool, it will never be used again.
func (*Pool) Do ¶
func (p *Pool) Do(fn func(map[interface{}]interface{}))
Do calls fn while holding the write lock for the pool
func (*Pool) Get ¶
Get fetches the Qid currently associated with name from the pool. The Qid is only valid if the second return value is true.
func (*Pool) Put ¶
Put creates a new, unique Qid of the given type and adds it to the pool. The returned Qid should be considered read-only. Put will not overwrite an existing Qid; if there is already a Qid associated with name, it is returned instead.
Source Files ¶
pool.go
- Version
- v0.0.0-20221011015736-bf55d759d56b (latest)
- Published
- Oct 11, 2022
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 4 days ago –
Tools for package owners.