def get_worker(
    *queue_names: str,
    job_class: Optional[Union[str, Type[Job]]] = None,
    queue_class: Optional[Union[str, Type[DjangoRQ]]] = None,
    worker_class: Optional[Union[str, Type[Worker]]] = None,
    **kwargs,
) -> Worker:
    """
    Returns a RQ worker for all queues or specified ones.
    """
    job_class = get_job_class(job_class)
    queues = get_queues(*queue_names, job_class=job_class, queue_class=queue_class)
    # normalize queue_class to what get_queues returns
    queue_class = queues[0].__class__
    worker_class = get_worker_class(worker_class)
    return worker_class(
        queues,
        connection=queues[0].connection,
        exception_handlers=get_exception_handlers() or None,
        job_class=job_class,
        queue_class=queue_class,
        **kwargs
    )

    Returns a RQ worker for all queues or specified ones.
    
django_rq/workers.py