Skip to main content

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 in SysSignalListener

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

aiomisc_entrypoint-1.2.0.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

aiomisc_entrypoint-1.2.0-py3-none-any.whl (7.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page