将azure存储队列/表用于简单工作进程
mamba-paw的Python项目详细描述
paw包的基本项目。很多工作正在进行中。
创建任务:
# tasks.pyfrompawimporttask@task(description='Stupid simple example')deftask_one(print_me):print(print_me)returnTrue
启动工人:
# start_workers.pyfrompawimportMainPawWorkerimporttasks# importing tasks from tasks.py in local projectworkers=MainPawWorker(azure_storage_name='storage account name',azure_storage_private_key='storage account private key',azure_queue_name='name of the queue',azure_table_name='name of the table',tasks_module=tasks,workers=4)if__name__=='__main__':workers.start_workers()
将任务排队:
# queue_tasks.pyfrompawimportqueue_taskqueue_task(task_name='task_one',account_name='storage account name',account_key='storage account private key',queue_name='name of the queue',args=['List','of','arguments'],kwargs={'Key_word':'arguments'})