withTtl

abstract fun withTtl(ttl: Int): SyncOptions

Set time to live for the Sync object in seconds.

This TTL specifies the minimum time the object will live, sometime soon after this time the object will be deleted.

If time to live is not specified, object lives infinitely long.

TTL could be used in order to auto-recycle old unused objects, but it is not recommended to build some app logic like timers using ttl.

This setting works with all object types, however note that it is applicable only when creating an object. When (re)opening an existing object, new TTL is not applied, and instead an old setting is retained, in order to avoid unexpected read-only object change.

Parameters

ttl

Time to live in seconds from now or INFINITE_DURATION to indicate no expiry.