Skip to content

feat: add lifecycle management support for synchronous and asynchronous clients#110

Open
kryachkow wants to merge 1 commit into
epam:developmentfrom
kryachkow:feat/92-lifecycle
Open

feat: add lifecycle management support for synchronous and asynchronous clients#110
kryachkow wants to merge 1 commit into
epam:developmentfrom
kryachkow:feat/92-lifecycle

Conversation

@kryachkow

Copy link
Copy Markdown

Applicable issues

#92

Description of changes

Summary

Implements lifecycle management APIs for DIAL clients and pools to enable deterministic shutdown of underlying httpx clients (Issue #92).

What’s included

  • Added sync client lifecycle methods:
    • Dial.close()
    • Dial.__enter__() / Dial.__exit__()
  • Added async client lifecycle methods:
    • AsyncDial.aclose()
    • AsyncDial.__aenter__() / AsyncDial.__aexit__()
  • Added sync pool lifecycle methods:
    • DialClientPool.close()
    • DialClientPool.__enter__() / DialClientPool.__exit__()
  • Added async pool lifecycle methods:
    • AsyncDialClientPool.aclose()
    • AsyncDialClientPool.__aenter__() / AsyncDialClientPool.__aexit__()
  • Added tests in tests/test_lifecycle.py for all new lifecycle and context-manager paths.
  • Updated README.md:
    • Added a Lifecycle Management section with sync/async client and pool examples.
    • Added TOC entry for the new section.
    • Fixed async pool import example to use aidial_client.

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@kryachkow kryachkow requested a review from adubovik as a code owner June 12, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant