本文整理汇总了Python中celery_tasktree.TaskTree.push方法的典型用法代码示例。如果您正苦于以下问题:Python TaskTree.push方法的具体用法?Python TaskTree.push怎么用?Python TaskTree.push使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类celery_tasktree.TaskTree
的用法示例。
在下文中一共展示了TaskTree.push方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: store_and_transcode
# 需要导入模块: from celery_tasktree import TaskTree [as 别名]
# 或者: from celery_tasktree.TaskTree import push [as 别名]
def store_and_transcode(track_id, session_key):
tr = Track.objects.get(pk=track_id)
ftype = filetype(tr.temp_path)
transcoders = [store_ogg]
if ftype == 'mp3':
store_source = store_mp3
elif ftype == 'm4a':
store_source = store_m4a
else:
raise ValueError('file type not supported: %r' % ftype)
args = [tr.pk, session_key]
pipeline = TaskTree()
pipeline.push(store_source, args=args, kwargs=dict(source=True))
for trans in transcoders:
pipeline.push(trans, args=args)
pipeline.push(unlink_source, args=args)
pipeline.apply_async()
示例2: _icons_and_images
# 需要导入模块: from celery_tasktree import TaskTree [as 别名]
# 或者: from celery_tasktree.TaskTree import push [as 别名]
def _icons_and_images(self, bundle_obj):
pipeline = TaskTree()
pipeline.push(tasks.fetch_icon, args=[bundle_obj])
pipeline.push(tasks.generate_image_assets, args=[bundle_obj])
pipeline.apply_async()