Skip to main content

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.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mamba_paw-0.3.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file mamba-paw-0.3.0.tar.gz.

File metadata

  • Download URL: mamba-paw-0.3.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mamba-paw-0.3.0.tar.gz
Algorithm Hash digest
SHA256 61f015717aa0c48be34c346cc6139f258164ae864fd2967b895c5646824560a2
MD5 68d0e2cb9221930dbc2eb7fc60c397a7
BLAKE2b-256 a0631df1c826f82a88999a2b5c19b6aba27bc248ab0513907cf821cded1e8b67

See more details on using hashes here.

File details

Details for the file mamba_paw-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mamba_paw-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e30d2d9c9d8cbc6c6d64540dc507267bbb19f801657996f25939365a6476116b
MD5 93a6ef13b1c97aef3d25f1b821d26394
BLAKE2b-256 ae2b71fb9e9c72ef9966fabdd58b5a331401e57c7a1633f4365a00abeb7c10d5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page