Long polling in Django

后端 未结 1 1266
-上瘾入骨i
-上瘾入骨i 2021-01-05 23:59

I\'m using a sort of long polling in my Django app to return status messages about a long operation to the client as it progresses. I do this by returning an HttpResponse ob

相关标签:
1条回答
  • 2021-01-06 00:44

    Try:

    import itertools
    
    def my_long_operation():
        return itertools.chain(do_something(), do_something_else())
    
    0 讨论(0)
提交回复
热议问题