base_service
messageflux.base_service
BaseService
this class is the base class for all services
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name |
Optional[str]
|
the name of this service. if None, the name of the type will be used |
None
|
should_stop_on_signal |
bool
|
if True, the service will try to register SIGTERM and SIGINT on stop method. |
True
|
state_changed_event
property
this is an Event, that can be used to register on server state changes
ServiceState
Bases: Enum
the states of the service: INITIALIZING->(start)->STARTING->(prepare_service)->STARTED->(run_service)->STOPPING->(finalize_service)->STOPPED
INITIALIZED
class-attribute
instance-attribute
The service has been created, but has not been started yet
STARTING
class-attribute
instance-attribute
The service is starting, but is not running yet