Make it possible to simply import ib_async (or eventkit) without an event loop running #62
Replies: 5 comments 7 replies
-
I don't think we've seen that causing problems before. What error does it cause? You are right it shouldn't be doing things globally though. I can seem to import and test the event loop state even if nothing is running: >>> import asyncio
>>> f = asyncio.get_event_loop_policy().get_event_loop()
>>> f.is_running()
False We don't have an active fork of |
Beta Was this translation helpful? Give feedback.
-
I have requested the transfer |
Beta Was this translation helpful? Give feedback.
-
@fredmonroe could you please check ib-api-reloaded/eventkit#2 you can pull from get_event_loop branch and test the issue. i can't reproduce it. from my side it's working fine |
Beta Was this translation helpful? Give feedback.
-
Ok, I will check.
…On Thu, Aug 15, 2024 at 11:33 AM gnzsnz ***@***.***> wrote:
@fredmonroe <https://github.com/fredmonroe> could you please check
ib-api-reloaded/eventkit#2
<ib-api-reloaded/eventkit#2>
you can pull from get_event_loop
<https://github.com/ib-api-reloaded/eventkit/tree/get_event_loop> branch
and test the issue. i can't reproduce it. from my side it's working fine
image.png (view on web)
<https://github.com/user-attachments/assets/21ae5811-31d1-4e01-a648-3e5278db52bd>
—
Reply to this email directly, view it on GitHub
<#62 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACZGVHRPZ5YJHBQZQEK3K3ZRTC5XAVCNFSM6AAAAABMQWUJQ2VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAMZUHEZTCNY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
In case you didn't see my note on the PR, this fix works for me in my
environment - thanks for the change.
…On Thu, Aug 15, 2024 at 4:08 PM Fred Monroe ***@***.***> wrote:
Ok, I will check.
On Thu, Aug 15, 2024 at 11:33 AM gnzsnz ***@***.***> wrote:
> @fredmonroe <https://github.com/fredmonroe> could you please check
> ib-api-reloaded/eventkit#2
> <ib-api-reloaded/eventkit#2>
>
> you can pull from get_event_loop
> <https://github.com/ib-api-reloaded/eventkit/tree/get_event_loop> branch
> and test the issue. i can't reproduce it. from my side it's working fine
>
> image.png (view on web)
> <https://github.com/user-attachments/assets/21ae5811-31d1-4e01-a648-3e5278db52bd>
>
> —
> Reply to this email directly, view it on GitHub
> <#62 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AACZGVHRPZ5YJHBQZQEK3K3ZRTC5XAVCNFSM6AAAAABMQWUJQ2VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAMZUHEZTCNY>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***
> com>
>
|
Beta Was this translation helpful? Give feedback.
-
hey everyone - what's the status of eventkit which ib_async relies upon?
Is that part of the forking too?
I'd like to change eventkit (and thus ib_async) so that merely the act of importing it doesn't cause a failure if there is no event loop existing. (so i don't have to always have to do nest_async.apply())
currently this line:
https://github.com/erdewit/eventkit/blob/caec9382bf4e8d7ebf12e7772b7feaa39f930f74/eventkit/util.py#L24
main_event_loop = get_event_loop()
in eventkit.utils declares a global variable that fails if there is no running event loop on import
I have code that looks at ib_async types to automatically build database orm objects and so. If i'm in a notebook, or just generally don't have a running even loop, just as simple import ib_async will raise an exception
i think it would be trivial to fix this in eventit. Is there a preferred fork I could submit a PR to?
Beta Was this translation helpful? Give feedback.
All reactions