mode.types.services¶
Type classes for mode.services.
-
class
mode.types.services.DiagT(service: mode.types.services.ServiceT)¶ Diag keeps track of a services diagnostic flags.
-
flags: Set[str] = None¶
-
last_transition: MutableMapping[str, float] = None¶
-
abstract
set_flag(flag: str) → None¶
-
abstract
unset_flag(flag: str) → None¶
-
-
class
mode.types.services.ServiceT(*, beacon: mode.utils.types.trees.NodeT = None, loop: asyncio.events.AbstractEventLoop = None)¶ Abstract type for an asynchronous service that can be started/stopped.
See also
-
Diag: Type[DiagT] = None¶
-
diag: DiagT = None¶
-
async_exit_stack: AsyncExitStack = None¶
-
exit_stack: ExitStack = None¶
-
shutdown_timeout: float = None¶
-
wait_for_shutdown= False¶
-
restart_count: int = 0¶
-
supervisor: Optional[mode.types.supervisors.SupervisorStrategyT] = None¶
-
abstract
add_dependency(service: mode.types.services.ServiceT) → mode.types.services.ServiceT¶
-
abstract async
add_runtime_dependency(service: mode.types.services.ServiceT) → mode.types.services.ServiceT¶
-
abstract async
add_async_context(context: AsyncContextManager) → Any¶
-
abstract
add_context(context: ContextManager) → Any¶
-
abstract async
start() → None¶
-
abstract async
maybe_start() → bool¶
-
abstract async
crash(reason: BaseException) → None¶
-
abstract async
stop() → None¶
-
abstract
service_reset() → None¶
-
abstract async
restart() → None¶
-
abstract async
wait_until_stopped() → None¶
-
abstract
set_shutdown() → None¶
-
abstract property
started¶
-
abstract property
crashed¶
-
abstract property
should_stop¶
-
abstract property
state¶
-
abstract property
label¶
-
abstract property
shortlabel¶
-
property
beacon¶
-
abstract property
loop¶
-
abstract property
crash_reason¶
-