✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚡️ Concerned about the grid? Kyle Baranko teaches how to predicting peak loads using XGBoost. Register for the August webinar!

Asyncio inside dash callback


I am using pyppeteer library to generate pdfs inside callback. This library is implemented with asyncio and the code works just fine outside of the callback as a standalone program.

Sample code is available at https://github.com/pyppeteer/pyppeteer.

I get the error “RuntimeError: There is no current event loop in thread ‘Thread-6’.” as the get_event_loop fails. If a create new loop and use this, I get the error “ValueError: signal only works in main thread”.

Would asyncio even work with Flask/Dash?