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