Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InvokeIDPool ¶
InvokeIDPool is used to ensure that the set of IDs in use concurrently never contains any duplicates. The IDs start at 1 and increase without bound, but will never be larger than the peak number of concurrent uses.
InvokeIDPool's Get() and Release() methods can be used concurrently.
func NewInvokeIDPool ¶
func NewInvokeIDPool() *InvokeIDPool
NewInvokeIDPool creates and initializes an IDPool.
func (*InvokeIDPool) Get ¶
func (pool *InvokeIDPool) Get() (id uint32)
Get returns an ID that is unique among currently active users of this pool.
func (*InvokeIDPool) Release ¶
func (pool *InvokeIDPool) Release(id uint32)
Release recycles an ID back into the pool for others to use. Releasing back a value or 0, or a value that is not currently "checked out", will result in a panic because that should never happen except in the case of a programming error.