def enqueue(self, func, *args, **kwargs):
        """Enqueue a function call or a :doc:`job <job>`.

        :param func: Function or a :doc:`job <job>` object. Must be
            serializable and available to :doc:`workers <worker>`.
        :type func: callable | :doc:`kq.Job <job>`
        :param args: Positional arguments for the function. Ignored if **func**
            is a :doc:`job <job>` object.
        :param kwargs: Keyword arguments for the function. Ignored if **func**
            is a :doc:`job <job>` object.
        :return: Enqueued job.
        :rtype: :doc:`kq.Job <job>`

        **Example:**

        .. testcode::

            import requests

            from kafka import KafkaProducer
            from kq import  Job, Queue

            # Set up a Kafka producer.
            producer = KafkaProducer(bootstrap_servers='127.0.0.1:9092')

            # Set up a queue.
            queue = Queue(topic='topic', producer=producer)

            # Enqueue a function call.
            queue.enqueue(requests.get, 'https://www.google.com/')

            # Enqueue a job object.
            job = Job(func=requests.get, args=['https://www.google.com/'])
            queue.enqueue(job)

        .. note::

            The following rules apply when enqueueing a :doc:`job <job>`:

            * If ``Job.id`` is not set, a random one is generated.
            * If ``Job.timestamp`` is set, it is replaced with current time.
            * If ``Job.topic`` is set, it is replaced with current topic.
            * If ``Job.timeout`` is set, its value overrides others.
            * If ``Job.key`` is set, its value overrides others.
            * If ``Job.partition`` is set, its value overrides others.

        """
        return self._default_enqueue_spec.enqueue(func, *args, **kwargs)
Enqueue a function call or a :doc:`job <job>`.

        :param func: Function or a :doc:`job <job>` object. Must be
            serializable and available to :doc:`workers <worker>`.
        :type func: callable | :doc:`kq.Job <job>`
        :param args: Positional arguments for the function. Ignored if **func**
            is a :doc:`job <job>` object.
        :param kwargs: Keyword arguments for the function. Ignored if **func**
            is a :doc:`job <job>` object.
        :return: Enqueued job.
        :rtype: :doc:`kq.Job <job>`

        **Example:**

        .. testcode::

            import requests

            from kafka import KafkaProducer
            from kq import  Job, Queue

            # Set up a Kafka producer.
            producer = KafkaProducer(bootstrap_servers='127.0.0.1:9092')

            # Set up a queue.
            queue = Queue(topic='topic', producer=producer)

            # Enqueue a function call.
            queue.enqueue(requests.get, 'https://www.google.com/')

            # Enqueue a job object.
            job = Job(func=requests.get, args=['https://www.google.com/'])
            queue.enqueue(job)

        .. note::

            The following rules apply when enqueueing a :doc:`job <job>`:

            * If ``Job.id`` is not set, a random one is generated.
            * If ``Job.timestamp`` is set, it is replaced with current time.
            * If ``Job.topic`` is set, it is replaced with current topic.
            * If ``Job.timeout`` is set, its value overrides others.
            * If ``Job.key`` is set, its value overrides others.
            * If ``Job.partition`` is set, its value overrides others.