Writing to an appengine blob asynchronously and finalizing it when all tasks complete

后端 未结 3 714
自闭症患者
自闭症患者 2021-01-07 08:06

I have a difficult problem.

I am iterating through a set of URLs parameterized by date and fetching them. For example, here is an example of one:

somewebserv

3条回答
  •  借酒劲吻你
    2021-01-07 08:41

    Have you read the Pipelines Getting Started docs? Pipelines can create other pipelines and wait on them, so doing what you want is fairly straightforward:

    class RecursivePipeline(pipeline.Pipeline):
      def run(self, param):
        if some_condition: # Too big to process in one
          p1 = yield RecursivePipeline(param1)
          p2 = yield RecursivePipeline(param2)
          yield RecursiveCombiningPipeline(p1, p2)
    

    Where RecursiveCombiningPipeline simply acts as a receiver for the values of the two sub-pipelines.

提交回复
热议问题