# Path: django_lightweight_queue/types.py
# class Logger(Protocol):
#     def log(
#         self,
#         level: int,
#         msg: str,
#         *args: Any,
#         exc_info: _ExcInfoType = ...,
#         stack_info: bool = ...,
#         extra: Optional[Dict[str, Any]] = ...,
#         **kwargs: Any
#     ) -> None:
#     def debug(
#         self,
#         msg: str,
#         *args: Any,
#         exc_info: _ExcInfoType = ...,
#         stack_info: bool = ...,
#         extra: Optional[Dict[str, Any]] = ...,
#         **kwargs: Any
#     ) -> None:
#     def info(
#         self,
#         msg: str,
#         *args: Any,
#         exc_info: _ExcInfoType = ...,
#         stack_info: bool = ...,
#         extra: Optional[Dict[str, Any]] = ...,
#         **kwargs: Any
#     ) -> None:
#     def warning(
#         self,
#         msg: str,
#         *args: Any,
#         exc_info: _ExcInfoType = ...,
#         stack_info: bool = ...,
#         extra: Optional[Dict[str, Any]] = ...,
#         **kwargs: Any
#     ) -> None:
#     def error(
#         self,
#         msg: str,
#         *args: Any,
#         exc_info: _ExcInfoType = ...,
#         stack_info: bool = ...,
#         extra: Optional[Dict[str, Any]] = ...,
#         **kwargs: Any
#     ) -> None:
#     def exception(
#         self,
#         msg: str,
#         *args: Any,
#         exc_info: _ExcInfoType = ...,
#         stack_info: bool = ...,
#         extra: Optional[Dict[str, Any]] = ...,
#         **kwargs: Any
#     ) -> None:
# 
# Path: django_lightweight_queue/utils.py
# @lru_cache()
# def get_backend(queue: QueueName) -> 'BaseBackend':
#     return get_path(app_settings.BACKEND_OVERRIDES.get(
#         queue,
#         app_settings.BACKEND,
#     ))()
# 
# Path: django_lightweight_queue/backends/base.py
# class BackendWithPauseResume(BackendWithPause, metaclass=ABCMeta):
#     @abstractmethod
#     def resume(self, queue: QueueName) -> None:
#         raise NotImplementedError()


import argparse
from django.core.management.base import BaseCommand, CommandError
from ...types import QueueName
from ...utils import get_backend
from ...backends.base import BackendWithPauseResume




class Command(BaseCommand):
    help = """
    Command to resume work immediately on a redis-backed queue.

    This removes a pause which may be in place for the given queue, though it
    may not cause workers to resume work immediately.
    """  # noqa:A003 # inherited name

    def add_arguments(self, parser: argparse.ArgumentParser) -> None:
        parser.add_argument(
            'queue',
            action='store',
            help="The queue to resume.",
        )

    def handle(self, queue: QueueName, **options: object) -> None:
        backend = get_backend(queue)


# Path: django_lightweight_queue/types.py
# class Logger(Protocol):
#     def log(
#         self,
#         level: int,
#         msg: str,
#         *args: Any,
#         exc_info: _ExcInfoType = ...,
#         stack_info: bool = ...,
#         extra: Optional[Dict[str, Any]] = ...,
#         **kwargs: Any
#     ) -> None:
#     def debug(
#         self,
#         msg: str,
#         *args: Any,
#         exc_info: _ExcInfoType = ...,
#         stack_info: bool = ...,
#         extra: Optional[Dict[str, Any]] = ...,
#         **kwargs: Any
#     ) -> None:
#     def info(
#         self,
#         msg: str,
#         *args: Any,
#         exc_info: _ExcInfoType = ...,
#         stack_info: bool = ...,
#         extra: Optional[Dict[str, Any]] = ...,
#         **kwargs: Any
#     ) -> None:
#     def warning(
#         self,
#         msg: str,
#         *args: Any,
#         exc_info: _ExcInfoType = ...,
#         stack_info: bool = ...,
#         extra: Optional[Dict[str, Any]] = ...,
#         **kwargs: Any
#     ) -> None:
#     def error(
#         self,
#         msg: str,
#         *args: Any,
#         exc_info: _ExcInfoType = ...,
#         stack_info: bool = ...,
#         extra: Optional[Dict[str, Any]] = ...,
#         **kwargs: Any
#     ) -> None:
#     def exception(
#         self,
#         msg: str,
#         *args: Any,
#         exc_info: _ExcInfoType = ...,
#         stack_info: bool = ...,
#         extra: Optional[Dict[str, Any]] = ...,
#         **kwargs: Any
#     ) -> None:
# 
# Path: django_lightweight_queue/utils.py
# @lru_cache()
# def get_backend(queue: QueueName) -> 'BaseBackend':
#     return get_path(app_settings.BACKEND_OVERRIDES.get(
#         queue,
#         app_settings.BACKEND,
#     ))()
# 
# Path: django_lightweight_queue/backends/base.py
# class BackendWithPauseResume(BackendWithPause, metaclass=ABCMeta):
#     @abstractmethod
#     def resume(self, queue: QueueName) -> None:
#         raise NotImplementedError()


# Path: django_lightweight_queue/management/commands/queue_resume.py
import argparse
from django.core.management.base import BaseCommand, CommandError
from ...types import QueueName
from ...utils import get_backend
from ...backends.base import BackendWithPauseResume





class Command(BaseCommand):
    help = """
    Command to resume work immediately on a redis-backed queue.

    This removes a pause which may be in place for the given queue, though it
    may not cause workers to resume work immediately.
    """  # noqa:A003 # inherited name

    def add_arguments(self, parser: argparse.ArgumentParser) -> None:
        parser.add_argument(
            'queue',
            action='store',
            help="The queue to resume.",
        )

    def handle(self, queue: QueueName, **options: object) -> None:
        backend = get_backend(queue)


        if not isinstance(backend, BackendWithPauseResume):