Issue with asyncio run in streamlit

Aww yeah in my case it was the very last widget I remember :confused:

Unfortunately the code is buried into company internal code. I’ll have to dig into it…


While I will continue following your debugging for an asyncio solution (too much FastAPI recently, so getting to learn asyncio too :slight_smile: ), I think this has a solution using Threading and injecting the ReportContext info in the new thread here and here. Maybe we have a kinda similar issue with asyncio, where t has 2 references, one in the Streamlit thread and one in the asyncio thread, and one of them is lost and returns None… or the t.markdown() reruns the asyncio.run and this breaks things ? something like that… ?

sorry this is all brainstorming without testing and I’m writing a HDP tutorial at the same time :laughing:

@tim @thiago maybe you have some tips on this, how ReportContext, threads, the Tornado event loop and an external asyncio loop would all run together when t.markdown is called ?

Fanilo