WebSocket Server sending messages periodically in python

后端 未结 3 1402
刺人心
刺人心 2021-01-14 05:53

I have a tornado web server in python:

import tornado.httpserver
import tornado.websocket
import tornado.ioloop
from tornado.ioloop import IOLoop
import tor         


        
3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-14 06:00

    You are calling the function in stead of starting a timer. Do this:

    threading.Timer(10, self.msg, args =('in timer',)).start()
    

提交回复
热议问题