Skip to content

Enhance event loop handling in Event class and utility functions#9

Open
gnzsnz wants to merge 3 commits intomainfrom
feat-getloop
Open

Enhance event loop handling in Event class and utility functions#9
gnzsnz wants to merge 3 commits intomainfrom
feat-getloop

Conversation

@gnzsnz
Copy link
Collaborator

@gnzsnz gnzsnz commented Sep 25, 2025

address #8

  • Added check to prevent running Event.run() within an already running asyncio event loop.
  • Implemented cleanup of pending tasks after running the event list.
  • Updated get_event_loop() to handle different scenarios for retrieving the asyncio event loop.

…dress #8

- Added check to prevent running Event.run() within an already running asyncio event loop.
- Implemented cleanup of pending tasks after running the event list.
- Updated get_event_loop() to handle different scenarios for retrieving the asyncio event loop.
@gnzsnz gnzsnz requested a review from mattsta September 27, 2025 20:31
@gnzsnz
Copy link
Collaborator Author

gnzsnz commented Jan 20, 2026

py314 is working fine with this fix.

https://github.com/ib-api-reloaded/eventkit/actions/runs/21177052468/job/60909715662?pr=9#step:8:111

Please note that, now we get the deprecation warning with get_event_loop_policy, but not with asyncio.get_event_loop() so the (knock on good) way forward should be to use asyncio.get_event_loop().

dev/eventkit/eventkit/util.py:27: DeprecationWarning: 'asyncio.get_event_loop_policy' is deprecated and slated for removal in Python 3.16
    return asyncio.get_event_loop_policy().get_event_loop()

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