from abc import ABC, abstractmethod
import asyncio
from .types import Controller

class Component(ABC):
    def __init__(self, /, controller: Controller, **kwargs):
        super().__init__(**kwargs)
        self.controller = controller
    
    async def start(self):
        self.loop = asyncio.get_running_loop()
        await self.run()

    @abstractmethod
    async def run(self):
        ...