Playing around with the AsyncFoundryClient in FoO, I managed to run some real async code querying the ontology which is great because it sped up my calculations by a factor of 5. However, the I noticed at least in the code repository environment that the success of the function is random. Yes it is still in preview but I would like to understand the problem a little bit better…
I am mixing synchronous client “FoundryClient()” with the “AsyncFoundryClient” to fall back to synchronous in some cases where i need it due to some dependency injection pattern into synchronous functions. Anyways. Is there a way to ensure that the event loop does not close during function execution?
edit: also regarding the whole TCP session handling, I would’ve expected to get some sort of context manager that handles the async sessions…
Found the issue… I forgot to pass the Config() from the OSDK to the AsyncFoundryClient.
If i pass the config, auth and hostname directly from OSDK client, everything works as expected