Skip to main content

worker

simple worker

Note: this package is still in alpha. Use with caution !

Quickstart

Install worker:

pip install worker

Use worker:

data = [
           {'hello': 'world'},
       ] * 40
info = {
    'worker': 'xxx.yyy.worker_do_sth'
}
worker = Worker(mode='thread')
resp = worker.work(data, info)
print(resp)
def worker_do_sth(data, info):
    print(data)
    return data

def callback(results):
    print('final')
    print(results)


def test_celery():
    data = [
               'u11', 'u22', 'u33', 'u44',
               'u21', 'u22', 'u23', 'u24',
               'u31', 'u32', 'u33', 'u34',
               'u41', 'u42', 'u43', 'u44',
               'u51', 'u52', 'u53', 'u54',
           ]*8
    info={
        'celery_worker': 'test.functional.test_celery.simple',
        'worker': 'test.functional.test_celery.worker_do_sth',
        'celery_max_workers': 4,
        'celery_chunk_size': 80,
        'chunk_size': 20,
        'final_callback': 'test.functional.test_celery.callback',
        'queue': '123'
    }

    worker = Worker(mode='celery')
    resp = worker.work(data, info)
    return resp

Metadata

Release files for worker 2018.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for worker 2018.4.1
File Interpreter ABI Platform Actions
worker-2018.4.1-py3-none-any.whl Python 3 none any Details for worker-2018.4.1-py3-none-any.whl

Release files / worker-2018.4.1-py3-none-any.whl

Download URL worker-2018.4.1-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7a9d1b390801c869e081df1fd6a289da396b0d1b1493eff47be870128c886252
BLAKE2b-256 checksum
How to use checksums
3dc5bef2cd6d128cb328e8190b2c81716aad3da1d69e4b737e7ebff53f76f483
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for worker 2018.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page