The typical Service Component takes care of interacting with external systems: Databases, Remote Web APIs, Messaging systems, etc. and provides an API for internal consumption.

Check out the Connecting Services example to see how a service can integrate and interact with other services.

class aioli.service.BaseService(unit, config_override=None)[source]

Base Service class


unit – Attach to this unit

  • app – Application instance
  • registry – Application ImportRegistry
  • unit – Parent Unit
  • config – Unit configuration
  • log – Unit logger

Reuses existing instance of the given Service class, in the context of the Unit it was first registered with.

Parameters:cls – Service class
Returns:Existing Service instance

Creates a new instance of the given Service class in the context of the current Unit.

Parameters:cls – Service class
Returns:Integrated Service

Called when the Application is shutting down gracefully


Called after the Unit has been successfully attached to the Application and the Loop is available