Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Future ¶
func SlowFunction ¶
type InnerFuture ¶
type InnerFuture struct {
// contains filtered or unexported fields
}
func (*InnerFuture) Result ¶
func (f *InnerFuture) Result() (string, error)
type Shard ¶
type Shard[K comparable, V any] struct { sync.RWMutex // Compose from sync.RWMutex // contains filtered or unexported fields }
type ShardedMap ¶
type ShardedMap[K comparable, V any] []*Shard[K, V]
func NewShardedMap ¶
func NewShardedMap[K comparable, V any](nshards int) ShardedMap[K, V]
NewShardedMap creates and initializes a new ShardedMap with the specified number of shards.
func (ShardedMap[K, V]) Delete ¶
func (m ShardedMap[K, V]) Delete(key K)
Delete removes a value from the map. If key doesn't exist in the map, this method is a no-op.
func (ShardedMap[K, V]) Get ¶
func (m ShardedMap[K, V]) Get(key K) V
Get retrieves and returns a value from the map. If the value doesn't exist, nil is returned.
func (ShardedMap[K, V]) Keys ¶
func (m ShardedMap[K, V]) Keys() []K
Keys returns a list of all keys in the sharded map.
func (ShardedMap[K, V]) Set ¶
func (m ShardedMap[K, V]) Set(key K, value V)
type TimeoutFunction ¶
type WithContext ¶
func Timeout ¶
func Timeout(f TimeoutFunction) WithContext
Click to show internal directories.
Click to hide internal directories.