Skip to main content

Encapsulate tasks safely using processes.

Project description

task_process_wrap

Encapsulate tasks safely using processes

install

pip install task_process_wrap

usage

from task_process_wrap import TaskProcessWrap
import time


tpw = TaskProcessWrap(["python", "-c", "import time; [(print(i, flush=True), time.sleep(1)) for i in range(100)]"])
tpw.start()


while True:
    print(tpw.info())
    time.sleep(0.5)
    if tpw.info()["status"] in ["done", "killed"]:
        break
    if tpw.info()["run_time"] > 10:
        tpw.kill()


print(tpw.info())

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

task_process_wrap-0.1.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

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

task_process_wrap-0.1.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file task_process_wrap-0.1.0.tar.gz.

File metadata

  • Download URL: task_process_wrap-0.1.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.11.15 Windows/10

File hashes

Hashes for task_process_wrap-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e5632a6fdf856c46b14f515e43e61edcea77bccc69435176750c28aa51f315f5
MD5 ca0d919557e85aad551900c83d5523c5
BLAKE2b-256 f425edce17c26ee4f2ee9a989bdc7a703485d5efeff7f58398e8b7a7d31027d2

See more details on using hashes here.

File details

Details for the file task_process_wrap-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: task_process_wrap-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.11.15 Windows/10

File hashes

Hashes for task_process_wrap-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a68ab6c84d5809edd0ba47228226698b226619f84f5250e6bb6bd971f66f47fa
MD5 81e081ea7bf2c32446446c43119baa6f
BLAKE2b-256 2f944d5855dae1f9fb989fb40a91663410173a6775a8ad1794e259bdbc4b0225

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