在GAE Python中并行化get_serving_url

时间:2015-12-06 11:25:55

标签: python-2.7 google-app-engine tasklet

Traces图表显示/images.GetUrlBase调用我的搜索功能。我尝试将其get_serving_url ()并行调用,但Traces图表仍将调用显示为顺序 如何使其平行?

enter image description here

我的尝试

class Gets 
    @staticmethod 
    @ndb.tasklet 
    def get_img_url_parallel ( image_key ): 
        url     = yield images.get_serving_url_async (image_key) 
        raise ndb.Return ( url ) 


@toplevel 
def search (..): 
    :: 
    for record in record_list: 
        :: 
        for photo in record.photo_list: 
            if (photo != ""): 
                yielded_photo   = yield Gets.get_img_url_parallel ( photo ) 
                photo_list.append ( yielded_photo  ) 
::

我是新手,但是,tasklet。

0 个答案:

没有答案