Skip to content

Instantly share code, notes, and snippets.

View dhdaines's full-sized avatar

David Huggins-Daines dhdaines

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dhdaines
dhdaines / async_tasks.py
Created March 14, 2025 17:42
Running asyncio tasks in a separate thread under streamlit
import asyncio
import threading
from concurrent import futures
import streamlit as st
def create_async_loop():
print("CREATE_ASYNC_LOOP START")
loop = asyncio.new_event_loop()
st.session_state.event_loop = loop