Skip to main content

The easy way to catch signals

Project description

A Python library for receiving Unix style signals.

Build Status Coverage Status Package Status

This library is meant to be a simple way to deal with handling signals, while avoiding callbacks.

Install it with pip

pip install aerial

A simple use looks like this:

>>> import time
>>> import signal
>>>
>>> import aerial
>>> def main_loop():
...     while not aerial.received(signal.SIGTERM):
...         if aerial.received(signal.SIGHUP):
...             print('Got a SIGHUP')
...         time.sleep(.5)
...     print('See you later')
...
>>>

And try out the demo by running the module.

python -m aerial
[ PID 10852 ] Hello, send me a SIGTERM to exit, or a SIGHUP for a trick  #  In another terminal
[ PID 10852 ] Neat huh?                                                  #  kill -SIGHUP 10852
[ PID 10852 ] See you later                                              #  kill -SIGTERM 10852

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for aerial, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size aerial-0.1.0-py2.py3-none-any.whl (4.9 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size aerial-0.1.0.tar.gz (20.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page