Damon Yuan

Results 6 comments of Damon Yuan

I have make a pull request, please check

> RuntimeError: This event loop is already running Largely possible that it is caused by the cache added to the `getLoop()` function, same loop got returned again. Anyone here can...

Thanks @mattsta, here you go. ``` import logging from threading import Thread from ib_async import IB from ib_async import util FORMAT = '[%(asctime)s][%(levelname)s][%(threadName)s] %(message)s' logging.basicConfig( level=logging.INFO, format=FORMAT ) logging.getLogger('ib_async').setLevel(logging.INFO) logging.getLogger('asyncio').setLevel(logging.INFO)...

Another finding in util.run() is that the `loop = getLoop()` will return same object in the 2 threads, verified by ``` print(id(loop)) ``` my python version is `Python 3.13.1`

``` @functools.cache # to be removed or same loop being returned for even different threads def getLoop(): """Get asyncio event loop or create one if it doesn't exist.""" try: #...

@mattsta thanks for the reply while let's pull back a bit from the the design as it's better to reflect the business reasons in different cases. In my case I...