No project description provided
Project description
Aiomisc Entrypoint
Alternative way to run aiomisc entrypoint with processors added behavior to start and stop events of entrypoint and custom query logger.
Basic usage
from aiomisc_entrypoint import Entrypoint
ep = Entrypoint()
ep.clear_environ()
ep.change_user()
ep.system_signals_listener()
ep.register_services_in_context()
ep.first_start_last_stop()
ep.run_forever()
Extended usage
from signal import SIGINT, SIGTERM, SIGKILL
from aiomisc import Service
from aiomisc_entrypoint import Entrypoint
class TestService(Service):
async def start(self):
...
async def main():
...
services = (
TestService(context_name='svc1'),
TestService(context_name='svc2'),
)
ep = Entrypoint(*services)
ep.clear_environ(lambda x: x.startwith('APP_'))
ep.change_user('user')
ep.system_signals_listener(SIGINT, SIGTERM, SIGKILL)
ep.register_services_in_context()
ep.first_start_last_stop()
ep.run_until_complete(main())
Release Notes:
v1.0.1
- fix error with set loop for
asyncio.Event
inSysSignalListener
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
Built Distribution
Close
Hashes for aiomisc_entrypoint-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbe5926915a28f35ebb6951e076c4a411e92876eb237d529ad7ec582b962cb8b |
|
MD5 | d2e906679806da93623f3140eb4ddd3e |
|
BLAKE2b-256 | 6fec71bad3a3009df9a9b1577b31771b9b82ad161e8e853b2fd19535e05cb674 |