google 应用引擎中的延迟任务是否并行化?
Are deferred tasks parallelized in google app engine?
我有一个 CRON 作业,它每天将 20 个新文件的列表从 S3 存储桶导入 GS 存储桶。
这是我的代码:
import webapp2
import yaml
from google.appengine.ext import deferred
class CronTask(webapp2.RequestHandler):
def get(self):
with open('/my/config/file') as file:
config_dict = yaml.load(file_config_file)
for file_to_load in config_dict:
deferred.defer(my_import_function, file_to_load)
app = webapp2.WSGIApplication([
('/', CronTask)
], debug=True)
我的问题:这个加载作业是由队列进程使用 deferred.defer
函数自动并行化的,还是我自己并行化的?
如果我们是第二种情况,我可以使用什么技术来有效地并行化这个加载过程?
这将取决于您的模块 scaling settings, and the queue's processing settings 但默认情况下任务将以一定的并行度执行。
我有一个 CRON 作业,它每天将 20 个新文件的列表从 S3 存储桶导入 GS 存储桶。
这是我的代码:
import webapp2
import yaml
from google.appengine.ext import deferred
class CronTask(webapp2.RequestHandler):
def get(self):
with open('/my/config/file') as file:
config_dict = yaml.load(file_config_file)
for file_to_load in config_dict:
deferred.defer(my_import_function, file_to_load)
app = webapp2.WSGIApplication([
('/', CronTask)
], debug=True)
我的问题:这个加载作业是由队列进程使用 deferred.defer
函数自动并行化的,还是我自己并行化的?
如果我们是第二种情况,我可以使用什么技术来有效地并行化这个加载过程?
这将取决于您的模块 scaling settings, and the queue's processing settings 但默认情况下任务将以一定的并行度执行。