Uses Azure storage queue/table for a simple worker
Project description
Base project for the paw package. Very much a work in progress.
To create tasks:
# tasks.py
from paw import task
@task(description='Stupid simple example')
def task_one(print_me):
print(print_me)
return True
To start a worker:
# start_workers.py
from paw import MainPawWorker
import tasks # importing tasks from tasks.py in local project
workers = 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()
To queue a task:
# queue_tasks.py
from paw import queue_task
queue_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'}
)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mamba-paw-0.3.1.tar.gz
(7.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mamba-paw-0.3.1.tar.gz.
File metadata
- Download URL: mamba-paw-0.3.1.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
378f74cdeb184b48f3206d76aee874318e6c8a40f93c0ac503ebee840a23cfa7
|
|
| MD5 |
190ecb0302db3b1ea7aa113e423200bb
|
|
| BLAKE2b-256 |
0d958692b2bba06e73c39e625de9f52ad2f8e4b08f37d35918415b02797923f7
|
File details
Details for the file mamba_paw-0.3.1-py3-none-any.whl.
File metadata
- Download URL: mamba_paw-0.3.1-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7ead38e450cedc7c9edfb5638cde58705181a3643c9e8c95096606bd9664b56
|
|
| MD5 |
17e7ffd40154a518ea785faf938f994c
|
|
| BLAKE2b-256 |
d410a3837fc71b6e54d0c55795efb22ac22fdf0c17cbd96cef3d04afab82b942
|