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.

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

mode.Service.

wait_for_shutdown = False
restart_count = 0
supervisor = 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() → None
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