Skip to main content

WARP: Wrapper around Replicated Processes

WARP is a light-weight manager for background processes.

Functionality

  • Easily spawn any process as a managed subprocess
  • Automatic recover from failed process
  • Runs completely async
  • Cleanly exits in a safe order (subprocess, WARP manager, then main process)

Overview

So you need to run a subprocess in the background of your Python application. How do you do it?

  • If you simply start the process in an async way, how can you ensure that the process can is restarted if it exits?
  • If you start the process in a synchronous way, how do you ensure that the rest of your program continues to execute?
  • If you use supervisord, how do you ensure that all your users have supervisord installed ahead of time?
  • If you use celery or some kind of heavy weight solution, you now need standalone infra and need to manage a lot of complexity

WARP makes it very simple to manage a background process in a self-healing way. The subprocess runs in a background thread that continually monitors the health of the subprocess. WARP is also able to intelligently support interrupt signals.

Installation

pip install warp

Usage

Import WARP

from warp import Warp

Create a WARP object

wp = Warp(command="dummy_server.py")

Start the WARP process

wp.start()

The process will automatically be killed (cleanly) when the main process exits

Alternatively you may also forcefully stop this background process

wp.stop()

Testing

Run the following command from the repo root

pytest

Python Compatibility

WARP only supports the following Python versions

  • 3.7
  • 3.8
  • 3.9

Contributing

WARP is a community project. Feel free to submit a PR and/or an issue if you are looking for more functionality or found a bug!

Metadata

Release files for warp 1.0.4

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

Source distribution (sdist)

Source distribution for warp 1.0.4
File Size Uploaded
warp-1.0.4.tar.gz 6.1 kB Details

Built distribution (wheel)

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

Total release size: 12.2 kB

Release files / warp-1.0.4.tar.gz

Download URL warp-1.0.4.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bab40b58d5e82fcb549390b4793205b65792fa68a5dbfed7602dd76c7390533e
BLAKE2b-256 checksum
How to use checksums
5bd83b6a858a3509390034fbc228858ced7dacfd3610aae5a73cba36bd0240c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12

Release files / warp-1.0.4-py3-none-any.whl

Download URL warp-1.0.4-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b56c39727bea5ecc5dd3088753ddea24e79fb18529ac08ac591ce03519b3226
BLAKE2b-256 checksum
How to use checksums
75ca22c0b316e96e7e929f6dbb48f2af6e11baffe2efcb6cd96ee71af3268186
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

1 release file

0.1

1 release file

0.0.1

2 release files

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