我有一个CRON工作,每天从一个S3 bucket向一个GS bucket导入一个包含20个新文件的列表。你知道吗
这是我的密码:
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和队列的processing settings,但默认情况下,任务将以某种并行方式执行。你知道吗
相关问题 更多 >
编程相关推荐