Updating page with Redis PubSub

Hello,

I’m working on a project using Streamlit and I’m unsure if I’m wasting time or if what I want to do is possible.

For a school project, I have connected Streamlit to a Redis database. I am trying to build a very simple chat app. Everything works: you can send messages, and once a message is sent, the chat refreshes with a st.rerun() to show the new messages.

However, now I need to implement Redis Pub/Sub to automatically refresh the chat page when a new message is added from another client.

The problem I’m experiencing is that Streamlit does not seem to allow multithreading. Therefore, I cannot run a separate thread to create a pubsub object that listens for updates.

Is there any way to get around this? I simply want to st.rerun() when the server pings the client.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.