from clarabot_nano.gateway.state.gateway import GatewayState
from clarabot_nano.gateway.state.inter import gateway_run_inter_nano_job
from clarabot_nano.inter.job import AbstractInterNanoJobQueue, AbstractInterNanoJob


class GatewayInterNanoJobQueue(AbstractInterNanoJobQueue):
    def __init__(self, gws: GatewayState):
        AbstractInterNanoJobQueue.__init__(self)
        self.gws = gws

    async def _run_job(self, job: AbstractInterNanoJob):
        await gateway_run_inter_nano_job(self.gws, job)
