""" A RedirectionProvider Service Provider """

from config import queue
from masonite.drivers import QueueAsyncDriver
from masonite.managers import QueueManager
from masonite.provider import ServiceProvider


class QueueProvider(ServiceProvider):

    wsgi = False

    def register(self):
        self.app.bind('QueueAsyncDriver', QueueAsyncDriver)
        self.app.bind('QueueManager', QueueManager)
        self.app.bind('QueueConfig', queue)

    def boot(self, QueueConfig, queue: QueueManager):
        self.app.bind(
            'Queue',
            queue(self.app).driver(QueueConfig.DRIVER)
        )
