Flask socketio blocked by something during time.sleep

This page summarizes the projects mentioned and recommended in the original post on /r/codehunter

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • Flask-SocketIO

    Socket.IO integration for Flask applications.

  • I'm running a Flask server on my local machine and am using it to pull data from a serial port and display it in real time on a webpage with Flask-socketio. I followed the example here and am encountering an interesting behavior. I was able to replicate the results of the example, but when I alter the background_thread function to include reading and parsing data from the serial port, something seems to be blocking the socket from sending the data. My code correctly establishes a socket and opens the connection, and can even emit messages correctly at the beginning of the thread function, but once it hits a time.sleep(5), emitting doesn't work anymore. Here's the original thread function that works (and includes a time.sleep()!):

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts