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.
TbCS's
put(path, value, opts)accepts an optionalopts.ttl(seconds). When present, the server sets the record'sdeadline = 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 andoperation.Optionis 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, thenPut(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.