mode.supervisors¶
Supervisors.
Naming here is taken from Erlang ;-)
Don’t know supervisors? Read about them them here: http://learnyousomeerlang.com/supervisors
-
class
mode.supervisors.SupervisorStrategy(*services: mode.types.services.ServiceT, max_restarts: Union[datetime.timedelta, float, str] = 100.0, over: Union[datetime.timedelta, float, str] = 1.0, raises: Type[BaseException] = <class 'mode.exceptions.MaxRestartsExceeded'>, replacement: Callable[[mode.types.services.ServiceT, int], Awaitable[mode.types.services.ServiceT]] = None, **kwargs: Any)¶ Base class for all supervisor strategies.
-
wakeup() → None¶
-
add(*services: mode.types.services.ServiceT) → None¶
-
discard(*services: mode.types.services.ServiceT) → None¶
-
insert(index: int, service: mode.types.services.ServiceT) → None¶
-
service_operational(service: mode.types.services.ServiceT) → bool¶
-
async
run_until_complete() → None¶
-
async
on_start() → None¶ Service is starting.
-
async
on_stop() → None¶ Service is being stopped/restarted.
-
async
start_services(services: List[mode.types.services.ServiceT]) → None¶
-
async
start_service(service: mode.types.services.ServiceT) → None¶
-
async
restart_services(services: List[mode.types.services.ServiceT]) → None¶
-
async
stop_services(services: List[mode.types.services.ServiceT]) → None¶
-
async
restart_service(service: mode.types.services.ServiceT) → None¶
-
property
label¶ Label used for graphs.
-
logger= <Logger mode.supervisors (WARNING)>¶
-
-
class
mode.supervisors.OneForOneSupervisor(*services: mode.types.services.ServiceT, max_restarts: Union[datetime.timedelta, float, str] = 100.0, over: Union[datetime.timedelta, float, str] = 1.0, raises: Type[BaseException] = <class 'mode.exceptions.MaxRestartsExceeded'>, replacement: Callable[[mode.types.services.ServiceT, int], Awaitable[mode.types.services.ServiceT]] = None, **kwargs: Any)¶ Supervisor simply restarts any crashed service.
-
logger= <Logger mode.supervisors (WARNING)>¶
-
-
class
mode.supervisors.OneForAllSupervisor(*services: mode.types.services.ServiceT, max_restarts: Union[datetime.timedelta, float, str] = 100.0, over: Union[datetime.timedelta, float, str] = 1.0, raises: Type[BaseException] = <class 'mode.exceptions.MaxRestartsExceeded'>, replacement: Callable[[mode.types.services.ServiceT, int], Awaitable[mode.types.services.ServiceT]] = None, **kwargs: Any)¶ Supervisor that restarts all services when a service crashes.
-
async
restart_services(services: List[mode.types.services.ServiceT]) → None¶
-
logger= <Logger mode.supervisors (WARNING)>¶
-
async
-
class
mode.supervisors.ForfeitOneForOneSupervisor(*services: mode.types.services.ServiceT, max_restarts: Union[datetime.timedelta, float, str] = 100.0, over: Union[datetime.timedelta, float, str] = 1.0, raises: Type[BaseException] = <class 'mode.exceptions.MaxRestartsExceeded'>, replacement: Callable[[mode.types.services.ServiceT, int], Awaitable[mode.types.services.ServiceT]] = None, **kwargs: Any)¶ Supervisor that if a service crashes, we do not restart it.
-
async
restart_services(services: List[mode.types.services.ServiceT]) → None¶
-
logger= <Logger mode.supervisors (WARNING)>¶
-
async
-
class
mode.supervisors.ForfeitOneForAllSupervisor(*services: mode.types.services.ServiceT, max_restarts: Union[datetime.timedelta, float, str] = 100.0, over: Union[datetime.timedelta, float, str] = 1.0, raises: Type[BaseException] = <class 'mode.exceptions.MaxRestartsExceeded'>, replacement: Callable[[mode.types.services.ServiceT, int], Awaitable[mode.types.services.ServiceT]] = None, **kwargs: Any)¶ If one service in the group crashes, we give up on all of them.
-
logger= <Logger mode.supervisors (WARNING)>¶
-
async
restart_services(services: List[mode.types.services.ServiceT]) → None¶
-