@@ -85,6 +85,33 @@ As a rule of thumb:
8585Refer the :ref: `data_types ` section for the full list
8686of parser/constructor classes you can use as type hints.
8787
88+ ExpiryPolicy
89+ ============
90+ File: `expiry_policy.py `_.
91+
92+ You can enable expiry policy (TTL) by two approaches.
93+
94+ Firstly, expiry policy can be set for entire cache by setting :py:attr: `~pyignite.datatypes.prop_codes.PROP_EXPIRY_POLICY `
95+ in cache settings dictionary on creation.
96+
97+ .. literalinclude :: ../examples/expiry_policy.py
98+ :language: python
99+ :dedent: 12
100+ :lines: 31-34
101+
102+ .. literalinclude :: ../examples/expiry_policy.py
103+ :language: python
104+ :dedent: 12
105+ :lines: 40-46
106+
107+ Secondly, expiry policy can be set for all cache operations, which are done under decorator. To create it use
108+ :py:meth: `~pyignite.cache.BaseCache.with_expire_policy `
109+
110+ .. literalinclude :: ../examples/expiry_policy.py
111+ :language: python
112+ :dedent: 12
113+ :lines: 53-60
114+
88115Scan
89116====
90117File: `scans.py `_.
@@ -558,13 +585,13 @@ Gather 3 Ignite nodes on `localhost` into one cluster and run:
558585
559586.. literalinclude :: ../examples/failover.py
560587 :language: python
561- :lines: 16-53
588+ :lines: 16-52
562589
563590Then try shutting down and restarting nodes, and see what happens.
564591
565592.. literalinclude :: ../examples/failover.py
566593 :language: python
567- :lines: 55-67
594+ :lines: 54-66
568595
569596Client reconnection do not require an explicit user action, like calling
570597a special method or resetting a parameter.
@@ -683,6 +710,7 @@ with the following message:
683710.. _type_hints.py : https://github.com/apache/ignite-python-thin-client/blob/master/examples/type_hints.py
684711.. _failover.py : https://github.com/apache/ignite-python-thin-client/blob/master/examples/failover.py
685712.. _scans.py : https://github.com/apache/ignite-python-thin-client/blob/master/examples/scans.py
713+ .. _expiry_policy.py : https://github.com/apache/ignite-python-thin-client/blob/master/examples/expiry_policy.py
686714.. _sql.py : https://github.com/apache/ignite-python-thin-client/blob/master/examples/sql.py
687715.. _async_sql.py : https://github.com/apache/ignite-python-thin-client/blob/master/examples/async_sql.py
688716.. _binary_basics.py : https://github.com/apache/ignite-python-thin-client/blob/master/examples/binary_basics.py
0 commit comments