2017-02-14 52 views
0

我爲kaldi運行gstreamer server,它在內部使用龍捲風爲轉錄提供HTTP終點,例如, example.com:8888/dynamic/recognize如何在Tornado服務器中設置請求超時?

我認爲這是相關代碼:

class Application(tornado.web.Application): 
    def __init__(self): 
     settings = dict(
      template_path=os.path.join(os.path.dirname(os.path.dirname(__file__)), "templates"), 
      static_path=os.path.join(os.path.dirname(os.path.dirname(__file__)), "static"), 
      autoescape=None, 
     ) 

     handlers = [ 
      [...] 
      (r"/client/dynamic/recognize", HttpChunkedRecognizeHandler), 
      [...], 
     ] 
     tornado.web.Application.__init__(self, handlers, **settings) 

Source

我不熟悉的龍捲風,但是看着tornado.web.Applicationdocs,我不請參閱settings中的任何超時提示。

我看到其他幾個類似的問題,例如, this one,但他們處理客戶端。 This answer似乎相關,但我不知道如何應用它在我的情況。

回答

1

Tornado沒有通用的超時機制,因爲它經常用於長輪詢和類似的請求。應用程序(在這種情況下,gstreamer)負責管理它想要自行設置的任何超時。

相關問題