Elaborate time to live and max idle in documentation

未关闭
#507 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
55/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
停滞
技术栈
python
领域
documentation

调研方向

从 issue 中链接的 Python 客户端 Map.put API 文档开始,并检查现有的 ttl 和 max_idle 描述。参考 Node.js API 的措辞以及链接的 map-configuration 文档;完成的标准是 Python 文档解释每个值何时重置,以及零或配置默认值如何生效。

由索引模型根据 Issue 内容生成。

描述

Type: Documentation

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.

主要语言
Python
星标
115
派生
78
平均合并
2 天 23 小时
30 天内合并 PR
2

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

hazelcast/hazelcast-python-client 的其他 Issue

查看 hazelcast/hazelcast-python-client 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。