jiengup opened a new issue, #4163:
URL: https://github.com/apache/iggy/issues/4163

   ### Description
   
   The Rust `Client` trait exposes both `disconnect()` and `shutdown()`, while 
the Python `IggyClient` currently exposes only `connect()`.
   
   `disconnect()` closes the current connection while allowing the client to 
connect again. `shutdown()` releases the underlying client resources and is 
terminal for binary transports.
   
   This covers B7 and B8 of the Python SDK parity work tracked in #3893.
   
   ```rust
   async fn disconnect(&self) -> Result<(), IggyError>;
   async fn shutdown(&self) -> Result<(), IggyError>;
   ```
   
   ### Affected area / component
   
   Python SDK
   
   ### Proposed solution
   
   - Add asynchronous `disconnect()` and `shutdown()` methods to the 
`#[pymethods]` block in `foreign/python/src/client.rs`.
   - Delegate directly to the corresponding Rust `IggyClient` methods and map 
failures through the existing `to_runtime_error` helper.
   - Regenerate `foreign/python/apache_iggy.pyi`, with both methods returning 
`Awaitable[None]`.
   - Extend `foreign/python/tests/test_connectivity.py` to verify:
     - `disconnect()` is idempotent.
     - Requests fail while disconnected.
     - A disconnected client can connect and authenticate again.
     - `shutdown()` is idempotent.
     - Requests after shutdown fail with the underlying client-shutdown error.
   - Document transport-specific behavior, including the no-op lifecycle used 
by HTTP.
   
   No new wrapper types are needed.
   
   ### Alternatives considered
   
   Expose only `disconnect()`. This would leave Python without the terminal 
cleanup operation provided by the Rust client.
   
   ### Contribution
   
   - [ ] I'm willing to submit a pull request to implement this feature
   
   ### Good first issue
   
   - [x] I think this could be a good first issue for a new contributor
   


-- 
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]

Reply via email to