ethanlin01x commented on code in PR #3776:
URL: https://github.com/apache/iggy/pull/3776#discussion_r3694723540
##########
foreign/python/README.md:
##########
@@ -58,6 +58,44 @@ maturin develop
pytest tests/ -v # Run tests (requires iggy-server running)
```
+## Client Configuration
+
+`IggyClient` takes either a server address or a `TcpConfig`. Configuring
`auto_login`
+lets the SDK replay the credentials whenever it reconnects, so a session
dropped by a
+server restart is recovered instead of surfacing as `Unauthenticated`:
+
+```python
+import asyncio
+from datetime import timedelta
+
+from apache_iggy import AutoLogin, IggyClient, TcpConfig, TcpReconnectionConfig
+
+
+async def main():
+ client = IggyClient(
+ TcpConfig(
+ server_address="127.0.0.1:8090",
+ auto_login=AutoLogin.username_password("iggy", "iggy"),
+ reconnection=TcpReconnectionConfig(
+ enabled=True,
+ max_retries=10,
+ interval=timedelta(seconds=2),
+ reestablish_after=timedelta(seconds=30),
+ ),
+ heartbeat_interval=timedelta(seconds=5),
+ )
+ )
+ await client.connect()
+
+
+asyncio.run(main())
+```
+
+`TcpConfig` also carries `tls_enabled`, `tls_domain`, `tls_ca_file`,
+`tls_validate_certificate` and `nodelay`. Every field is keyword-only and
defaults to the
+same value the Rust SDK uses. `IggyClient.from_connection_string(...)` remains
available
+for the same settings in string form.
Review Comment:
Addressed in 12da3bc0d
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]