Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IDTable ¶
IDTable is a map with random indexes for jobs and other cases where a random but unique index is required
type RWSync ¶
type RWSync[T any] struct { // contains filtered or unexported fields }
RWSync wraps any value in a RWMutex for safe concurrent use. Unlike Sync, concurrent read access is allowed (so don't use it for things like maps and pointers!)
type RWSyncMap ¶
type RWSyncMap[K comparable, T any] RWSync[map[K]T]
RWSyncMap is a map wrapped in a mutex for safe concurrent use Unlike Sync, concurrent read access is allowed (so don't use it for things like maps and pointers!)
func NewRWSyncMap ¶
func NewRWSyncMap[K comparable, T any]() *RWSyncMap[K, T]
NewRWSyncMap creates a new RWSync object with an empty map
func (*RWSyncMap[K, T]) Copy ¶ added in v0.0.3
func (s *RWSyncMap[K, T]) Copy() map[K]T
Copy returns a shallow copy of the wrapped map
func (*RWSyncMap[K, T]) DeleteKey ¶
func (s *RWSyncMap[K, T]) DeleteKey(key K)
DeleteKey removes a key from the wrapped map
type Sync ¶
type Sync[T any] struct { // contains filtered or unexported fields }
Sync wraps any value in a mutex for safe concurrent use
type SyncMap ¶
type SyncMap[K comparable, T any] Sync[map[K]T]
SyncMap is a map wrapped in a mutex for safe concurrent use
func NewSyncMap ¶
func NewSyncMap[K comparable, T any]() *SyncMap[K, T]
NewSyncMap creates a new Sync object with an empty map
func (*SyncMap[K, T]) Copy ¶ added in v0.0.3
func (s *SyncMap[K, T]) Copy() map[K]T
Copy returns a shallow copy of the wrapped map
func (*SyncMap[K, T]) DeleteKey ¶
func (s *SyncMap[K, T]) DeleteKey(key K)
DeleteKey removes a key from the wrapped map