from typing import Protocol

from bussdcc.context import ContextProtocol
from bussdcc.event import Event
from bussdcc.events import EventSchema


class ServiceProtocol(Protocol):
    name: str

    def attach(self, ctx: ContextProtocol) -> None: ...
    def detach(self) -> None: ...

    def start(self, ctx: ContextProtocol) -> None: ...
    def tick(self, ctx: ContextProtocol) -> None: ...
    def stop(self, ctx: ContextProtocol) -> None: ...

    def handle_event(self, ctx: ContextProtocol, evt: Event[EventSchema]) -> None: ...
