Skip to main content

Install

pip3 install ccprocesspool --upgrade --user

Process Pool Usage

#!/usr/bin/env python3
# _*_ coding:utf-8 _*_
import time
from ccprocesspool import CCProcessPool


class CCProcessPoolTestJob(object):

    @staticmethod
    def count_instant_to_10():
        for i in range(0, 10):
            print('instant', i)

    @staticmethod
    def count_quick_to(param: int):
        for i in range(0, param):
            print('quick', i)

    @staticmethod
    def count_slow_to(param: int):
        for i in range(0, param):
            print('slow', i)
            time.sleep(1)


if __name__ == '__main__':
    p_m = CCProcessPool('test_pool')
    p_m.add_job(CCProcessPoolTestJob.count_instant_to_10, None)
    p_m.add_job(CCProcessPoolTestJob.count_quick_to, (10, ))
    p_m.add_job(CCProcessPoolTestJob.count_slow_to, (10, ))
    p_m.add_job(CCProcessPoolTestJob.count_slow_to, (10, ))
    p_m.check_job()
    while True:
        time.sleep(2)
        p_m.check_job()
        pass

Restartable Process Usage

p_m = CCRestartableProcess('test_process', CCRestartableProcessTestJob.count_slow_to_10)
p_m.start()
while True:
    time.sleep(5)
    p_m.restart()
    pass

Metadata

Release files for ccprocesspool 2.1

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

Source distribution (sdist)

Source distribution for ccprocesspool 2.1
File Size Uploaded Provenance
ccprocesspool-2.1.tar.gz 2.4 kB Without provenance Details

Release files / ccprocesspool-2.1.tar.gz

Download URL ccprocesspool-2.1.tar.gz
Size 2.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e720f2aaf922cc1070ee06deb9e3c43f3586d93bc82adc11537799f94ee0ea5e
BLAKE2b-256 checksum
How to use checksums
74084c1a68414534359ddec55dcf8e94b6646c31f59df970a3f180ce1df914b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.9

Security for ccprocesspool 2.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.

Release history Release notifications | RSS feed

This release

2.1 This release

1 release file No provenance

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