You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am building a disstributed KV(https://github.com/kcmvp/daos) based on buntdb, for data rebalancing when new nodes join , the TTL of an entry need to be syncd as well. right now I am using two api call (Get & TTL) to get value and entry's ttl, it work well, but I found that it will use more time to get entries especially when there are lots of entrie need to be synced.
I would like to raise a PR by adding a new mthod GetWithTTL
1: this method will return value for a key together with it's TTL.
2: If the item does not exist or if the item has expired then ErrNotFound is returned.
3: A negative duration will be returned for items that do not have an expiration.
Thank you!
The text was updated successfully, but these errors were encountered:
kcmvp
changed the title
Feature Request: Get value with ttl
Enhancement: Get value with ttl
Mar 31, 2023
kcmvp
changed the title
Enhancement: Get value with ttl
Enhancement: add new method GetWithTTL to return value together with TTL
May 17, 2023
kcmvp
added a commit
to kcmvp/buntdb
that referenced
this issue
May 17, 2023
First, thank you very much for the great project!
I am building a disstributed KV(https://github.com/kcmvp/daos) based on buntdb, for data rebalancing when new nodes join , the TTL of an entry need to be syncd as well. right now I am using two api call (Get & TTL) to get value and entry's ttl, it work well, but I found that it will use more time to get entries especially when there are lots of entrie need to be synced.
I would like to raise a PR by adding a new mthod
GetWithTTL
func (tx *Tx) GetWithTTL(key string) (string, time.Duration, error)
1: this method will return value for a key together with it's TTL.
2: If the item does not exist or if the item has expired then ErrNotFound is returned.
3: A negative duration will be returned for items that do not have an expiration.
Thank you!
The text was updated successfully, but these errors were encountered: