Skip to content

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

Merged
adubovik merged 4 commits into
epam:developmentfrom
kryachkow:feat/92-lifecycle
Jun 22, 2026
Merged

feat: add lifecycle management support for synchronous and asynchronous clients#110
adubovik merged 4 commits into
epam:developmentfrom
kryachkow:feat/92-lifecycle

Conversation

@kryachkow

Copy link
Copy Markdown
Contributor

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
Danylo_Kriachkov added 2 commits June 22, 2026 15:14
…cycle

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	aidial_client/_client.py
#	aidial_client/_client_pool.py
@adubovik
adubovik enabled auto-merge (squash) June 22, 2026 16:43
@adubovik
adubovik merged commit da14cb9 into epam:development Jun 22, 2026
9 checks passed
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.

2 participants