Skip to content

Elaborate time to live and max idle in documentation #507

@srknzl

Description

@srknzl

Right now in python client docs we say this about ttl and max idle:

ttl (int) – Maximum time in seconds for this entry to stay in the map. If not provided, the value configured on the server side configuration will be used. Setting this to 0 means infinite time-to-live.

max_idle (int) – Maximum time in seconds for this entry to stay idle in the map. If not provided, the value configured on the server side configuration will be used. Setting this to 0 means infinite max idle time.

as can be found here:

https://hazelcast.readthedocs.io/en/stable/api/proxy/map.html?highlight=map#hazelcast.proxy.map.Map.put

A community user asked this in slack:

Hi, Can any one tell me if it possible to update a map and keep the original TTL that was set when it was created?

I understood it as he is asking if he can reset ttl to its first value when updating an entry, but it is the default behaviour already. See this section: https://docs.hazelcast.com/cloud/map-configurations.html#time-to-live

In Node.js client we have this explanation in the apidocs:

The entry will expire and get evicted after the TTL. It limits the lifetime of the entries relative to the time of the last write access performed on them. If the TTL is 0, then the entry lives forever. If the TTL is negative, then the TTL from the map configuration will be used (default: forever).

The entry will expire and get evicted after the Max Idle time. It limits the lifetime of the entries relative to the time of the last read or write access performed on them. If the Max Idle is 0, then the entry lives forever. If the Max Idle is negative, then the Max Idle from the map configuration will be used (default: forever). The time precision is limited by 1 second. The Max Idle that is less than 1 second can lead to unexpected behaviour.

which explains when ttl and max idle's are reset.

We should have more detail in python version too, at least we should mention when ttl and max idle reset.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions