Streaming Connection Using Python Bottle, Multiprocessing, and gevent

前端 未结 2 1748
礼貌的吻别
礼貌的吻别 2021-01-18 06:39

I have a Bottle application that uses subprocesses to do most of the work for requests. For routes that return a single response, I do something like what\'s below.

2条回答
  •  不要未来只要你来
    2021-01-18 07:13

    In your last example, worker.doStuff() returns a generator, which is iterable. You can just return that (change yield to return). Bottle accept iterables as return values, as long es they yield byte or unicode strings.

提交回复
热议问题