python - tornado一个请求就添加一个进程该怎么做?
PHP中文网
PHP中文网 2017-04-18 09:44:57
0
3
361

大致如下

class ListPetHandler(RequestHandler):
    def get(self):
        pass
        
        
class AddPetHandler(RequestHandler):
    def get(self):
        do_something()

其中的do_something()应该是在后端跑起一个独立于tornado server存在的Pet实例,而不是在请求结束之后就消失

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(3)
PHPzhong

I don’t quite understand what you’re thinking. Why do you want to keep running this instance? Can’t we use redis or the like for content storage?

伊谢尔伦

Use http://www.celeryproject.org/

巴扎黑

Isn’t the most common threading method enough to open a thread?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template