Skip to content

Extract shared async bridge and runtime management into centralized m…#64

Closed
wyeth93 wants to merge 1 commit intoDeepLink-org:mainfrom
wyeth93:main
Closed

Extract shared async bridge and runtime management into centralized m…#64
wyeth93 wants to merge 1 commit intoDeepLink-org:mainfrom
wyeth93:main

Conversation

@wyeth93
Copy link
Copy Markdown
Contributor

@wyeth93 wyeth93 commented Apr 10, 2026

…odules

Deduplicate event-loop bridging and lazy-init/shutdown/atexit patterns previously scattered across subprocess, transfer_queue, integrations, and streaming modules into _async_bridge.py and _runtime.py.

Overview:

Details:

Where should the reviewer start?

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

  • closes GitHub issue: #xxx

if loop is not None and loop.is_running():
try:
loop.call_soon_threadsafe(loop.stop)
except Exception:
loop = asyncio.get_running_loop()
if _async_init_lock is None or _async_init_lock_loop is not loop:
_async_init_lock = asyncio.Lock()
_async_init_lock_loop = loop
)
try:
asyncio.run(pul.shutdown())
except Exception:
if owns and get_shared_loop() is not None:
try:
stop_shared_loop(join_timeout=5)
except Exception:
from pulsing._runtime import clear_module_ownership

clear_module_ownership()
except ImportError:
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 10, 2026

Codecov Report

❌ Patch coverage is 81.32184% with 65 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
python/pulsing/_runtime.py 75.26% 23 Missing ⚠️
python/pulsing/_async_bridge.py 91.12% 15 Missing ⚠️
python/pulsing/subprocess/popen.py 29.41% 12 Missing ⚠️
python/pulsing/integrations/ray.py 0.00% 6 Missing ⚠️
python/pulsing/integrations/torchrun.py 0.00% 3 Missing ⚠️
python/pulsing/core/__init__.py 75.00% 2 Missing ⚠️
python/pulsing/streaming/sync_queue.py 80.00% 2 Missing ⚠️
python/pulsing/transfer_queue/client.py 96.00% 1 Missing ⚠️
python/pulsing/transfer_queue/manager.py 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
python/pulsing/bootstrap.py 61.36% <100.00%> (+40.37%) ⬆️
python/pulsing/core/helpers.py 56.16% <100.00%> (+10.81%) ⬆️
python/pulsing/transfer_queue/__init__.py 100.00% <100.00%> (ø)
python/pulsing/transfer_queue/client.py 98.86% <96.00%> (ø)
python/pulsing/transfer_queue/manager.py 72.34% <0.00%> (ø)
python/pulsing/core/__init__.py 88.23% <75.00%> (+0.73%) ⬆️
python/pulsing/streaming/sync_queue.py 89.65% <80.00%> (+3.94%) ⬆️
python/pulsing/integrations/torchrun.py 14.58% <0.00%> (+14.58%) ⬆️
python/pulsing/integrations/ray.py 7.27% <0.00%> (+7.27%) ⬆️
python/pulsing/subprocess/popen.py 53.33% <29.41%> (+10.42%) ⬆️
... and 2 more

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…odules

Deduplicate event-loop bridging and lazy-init/shutdown/atexit patterns
previously scattered across subprocess, transfer_queue, integrations,
and streaming modules into _async_bridge.py and _runtime.py.
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.

3 participants