Runs Python application in a fault-tolerant environment, continually rebooting after unexpected exceptions
Project description
app_manager
Runs Python application in a fault-tolerant environment, continually rebooting after unexpected exceptions.
- Uses Python3 standard library packages only
- app_manager.py contains AppManager class
examples
installation
pip install app_manager
running your app in the AppManager is simple
import ApplicationClass
from app_manager import AppManager
app = ApplicationClass()
AppManager(app.run, run_limit = None) # set run_limit to positive integer to run application at most n times
''' Exceptions will be printed to the console '''
alternatively, you can pass in your app's logger so that exceptions appear in your log output
from application_package import ApplicationClass, logger
from app_manager import AppManager
app = ApplicationClass()
AppManager(app.run, logger = logger)
''' Exceptions will be printed to the console and logged with the supplied logger'''
each instance of AppManager runs in its own process, so multiple application components can be launched successively
from application_package import AppMainClass, main_logger
from background_package import BackgroundAppClass, bg_logger
from app_manager import AppManager
app = AppMainClass()
comp = BackgroundAppClass()
AppManager(app.run, logger = main_logger)
AppManager(comp.run, logger = bg_logger)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
app_manager-0.0.0.2.tar.gz
(7.2 kB
view hashes)
Built Distribution
Close
Hashes for app_manager-0.0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1bccb5aab9e7329db487dcc7fa67df1f9d59e66d0472c0aff01eff9044fae1c |
|
MD5 | f93a15254a39caa4e03bfab096d8bc63 |
|
BLAKE2b-256 | f3b7f494f8e37c9a2cfba7cd9b2087d38a39296ef27ae8743f444e6a0a88baae |