Documentation
¶
Index ¶
- type CasCache
- func (cc *CasCache[K, V]) Get(key K) (value V, ok bool)
- func (cc *CasCache[K, V]) GetOrCompute(key K, producer func() (V, error)) (V, error)
- func (cc *CasCache[K, V]) Length() int
- func (cc *CasCache[K, V]) Set(key K, value V)
- func (cc *CasCache[K, V]) SetAll(m map[K]V)
- func (cc *CasCache[K, V]) TransformSetAndGet(key K, transformer func(old V) (V, error)) (V, error)
- type Channel
- type Queue
- type RelationCache
- type UnboundedChannel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CasCache ¶ added in v0.5.0
type CasCache[K comparable, V any] struct { // contains filtered or unexported fields }
func NewCasCache ¶ added in v0.5.0
func NewCasCache[K comparable, V any]() *CasCache[K, V]
func (*CasCache[K, V]) GetOrCompute ¶ added in v0.5.0
func (*CasCache[K, V]) TransformSetAndGet ¶ added in v0.5.0
type Channel ¶
type Channel[T any] struct { // contains filtered or unexported fields }
Channel is based on https://github.com/jtarchie/ringbuffer, but extended with the option to skip waiting on an empty output channel
func NewChannel ¶
func (*Channel[T]) ReceiveChannel ¶
func (c *Channel[T]) ReceiveChannel() <-chan T
type RelationCache ¶ added in v0.5.0
type RelationCache[V any] struct { // contains filtered or unexported fields }
func NewRelationCache ¶ added in v0.5.0
func NewRelationCache[V any]() *RelationCache[V]
func (*RelationCache[V]) Get ¶ added in v0.5.0
func (rc *RelationCache[V]) Get( oid uint32, ) (value V, present bool)
func (*RelationCache[V]) Set ¶ added in v0.5.0
func (rc *RelationCache[V]) Set( oid uint32, value V, )
type UnboundedChannel ¶
type UnboundedChannel[T any] struct { // contains filtered or unexported fields }
func MakeUnboundedChannel ¶
func MakeUnboundedChannel[T any]( initialCapacity int, ) *UnboundedChannel[T]
func (*UnboundedChannel[T]) Close ¶
func (uc *UnboundedChannel[T]) Close()
func (*UnboundedChannel[T]) Receive ¶
func (uc *UnboundedChannel[T]) Receive() T
func (*UnboundedChannel[T]) ReceiveChannel ¶
func (uc *UnboundedChannel[T]) ReceiveChannel() <-chan T
func (*UnboundedChannel[T]) Send ¶
func (uc *UnboundedChannel[T]) Send( item T, )
Click to show internal directories.
Click to hide internal directories.