Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ttl/ttl.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type value struct {
}

// TTL is an opaque structure that stores key/values in an internal map. These
// values have a time-to-live callback functions associated with them.
// values have a time-to-live callback function associated with them.
// Depending on configuration either these values are automatically deleted from
// the map on expiration.
type TTL struct {
Expand Down Expand Up @@ -87,7 +87,7 @@ func (tm *TTL) ttl(ctx context.Context, key any) {
}

// Put inserts the provided key and value into the TTL map. The ttl values
// designates the duration of the validity of this key value pair. The expired
// designates the duration of the validity of this key value-pair. The expired
Comment thread
Pricstas marked this conversation as resolved.
Outdated
// function is called when the duration expires and the remove callback is
// called when the key is Canceled.
func (tm *TTL) Put(pctx context.Context, ttl time.Duration, key any, val any, expired func(context.Context, any, any), remove func(context.Context, any, any)) {
Expand Down Expand Up @@ -159,7 +159,7 @@ func (tm *TTL) Delete(key any) (bool, error) {
return tm.delete(key)
}

// Len return the length of the TTL map.
// Len returns the length of the TTL map.
func (tm *TTL) Len() int {
tm.mtx.Lock()
defer tm.mtx.Unlock()
Expand Down