def using(self, timeout=None, key=None, partition=None):
        """Set enqueue specifications such as timeout, key and partition.

        :param timeout: Job timeout threshold in seconds. If not set, default
            timeout (specified during queue initialization) is used instead.
        :type timeout: int | float
        :param key: Kafka message key. Jobs with the same keys are sent to the
            same topic partition and executed sequentially. Applies only if the
            **partition** parameter is not set, and the producer’s partitioner
            configuration is left as default. For more details on producers,
            refer to kafka-python's documentation_.
        :type key: bytes
        :param partition: Topic partition the message is sent to. If not set,
            the producer's partitioner selects the partition. For more details
            on producers, refer to kafka-python's documentation_.
        :type partition: int
        :return: Enqueue specification object which has an ``enqueue`` method
            with the same signature as :func:`kq.queue.Queue.enqueue`.

        **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)

            url = 'https://www.google.com/'

            # Enqueue a function call in partition 0 with message key 'foo'.
            queue.using(partition=0, key=b'foo').enqueue(requests.get, url)

            # Enqueue a function call with a timeout of 10 seconds.
            queue.using(timeout=10).enqueue(requests.get, url)

            # Job values are preferred over values set with "using" method.
            job = Job(func=requests.get, args=[url], timeout=5)
            queue.using(timeout=10).enqueue(job)  # timeout is still 5

        .. _documentation: http://kafka-python.rtfd.io/en/master/#kafkaproducer
        """
        return EnqueueSpec(
            topic=self._topic,
            producer=self._producer,
            serializer=self._serializer,
            logger=self._logger,
            timeout=timeout or self._timeout,
            key=key,
            partition=partition
        )
Set enqueue specifications such as timeout, key and partition.

        :param timeout: Job timeout threshold in seconds. If not set, default
            timeout (specified during queue initialization) is used instead.
        :type timeout: int | float
        :param key: Kafka message key. Jobs with the same keys are sent to the
            same topic partition and executed sequentially. Applies only if the
            **partition** parameter is not set, and the producer’s partitioner
            configuration is left as default. For more details on producers,
            refer to kafka-python's documentation_.
        :type key: bytes
        :param partition: Topic partition the message is sent to. If not set,
            the producer's partitioner selects the partition. For more details
            on producers, refer to kafka-python's documentation_.
        :type partition: int
        :return: Enqueue specification object which has an ``enqueue`` method
            with the same signature as :func:`kq.queue.Queue.enqueue`.

        **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)

            url = 'https://www.google.com/'

            # Enqueue a function call in partition 0 with message key 'foo'.
            queue.using(partition=0, key=b'foo').enqueue(requests.get, url)

            # Enqueue a function call with a timeout of 10 seconds.
            queue.using(timeout=10).enqueue(requests.get, url)

            # Job values are preferred over values set with "using" method.
            job = Job(func=requests.get, args=[url], timeout=5)
            queue.using(timeout=10).enqueue(job)  # timeout is still 5

        .. _documentation: http://kafka-python.rtfd.io/en/master/#kafkaproducer