logo
  • 教程列表
  • SO官方文档
  • Python 服务器发送事件
    • Flask SSE
    • Asyncio SSE
  1. StackOverflow 文档
  2. Python Language 教程
  3. Python 服务器发送事件
  4. Flask SSE

Flask SSE

Created: November-22, 2018

@route("/stream")
def stream():
    def event_stream():
        while True:
            if message_to_send:
                yield "data: 
                    {}\n\n".format(message_to_send)"
    
    return Response(event_stream(), mimetype="text/event-stream")
  • Asyncio SSE
  • Python 服务器发送事件

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明