Skip to content

Support TTL on put #59

Description

@bigbes

TbCS's put(path, value, opts) accepts an optional opts.ttl (seconds). When present, the server sets the record's deadline = clock.realtime() + ttl; a background expiration fiber later batch-deletes records past their deadline.

The Go wrapper currently encodes a fixed 3-element {put, key, value} array in driver/tcs/operations.go and operation.Option is an empty struct, so there is no way to set TTL.

etcd compatibility

etcd has no per-key TTL — it uses leases: LeaseGrant(TTL)lease_id, then Put(key, value, clientv3.WithLease(id)). When the lease expires, all keys attached to it are deleted atomically. TbCS exposes per-key TTL natively; recommend keeping the API as a per-key TTL and document the etcd-vs-TbCS semantic difference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions