snsary.system.service

Base class for anything that needs to perform an action during the start or stop phases of a program. This could be something like spawning a thread, or storing data to disk. Each instance of a service is recorded in a global registry so it can be managed by the system module.

Module Contents

class snsary.system.service.Service

Bases: snsary.utils.logging.HasLogger, snsary.utils.storage.HasStore

start()

Called synchronously by the system module as part of program startup.

stop()

Called asynchronously by the system module when a program is stopping. The execution will eventually time out to ensure the overall program stops in good time.

snsary.system.service.clear_services()

Clear the global list of service instances. For testing use only.

snsary.system.service.get_services()

Return a list of all service instances.