diff options
| author | Ask Solem <ask@celeryproject.org> | 2014-11-03 21:00:13 +0000 |
|---|---|---|
| committer | Ask Solem <ask@celeryproject.org> | 2014-11-03 21:00:21 +0000 |
| commit | 0b4ee363f7e7391905dad28d599d0505eabc8f0d (patch) | |
| tree | 60332433466c0868f554a61ad96b67b3f7e6f4b7 /docs/userguide | |
| parent | 4aa1fb930ed05d373ebe0c241fda927251825c45 (diff) | |
| download | kombu-0b4ee363f7e7391905dad28d599d0505eabc8f0d.tar.gz | |
Doc example should use producer declare argument. Closes #423
Diffstat (limited to 'docs/userguide')
| -rw-r--r-- | docs/userguide/pools.rst | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/docs/userguide/pools.rst b/docs/userguide/pools.rst index e8d60008..6db37135 100644 --- a/docs/userguide/pools.rst +++ b/docs/userguide/pools.rst @@ -94,7 +94,6 @@ to the ``news`` exchange: .. code-block:: python from kombu import Connection, Exchange - from kombu.common import maybe_declare from kombu.pools import producers # The exchange we send our news articles to. @@ -108,12 +107,13 @@ to the ``news`` exchange: connection = Connection('amqp://guest:guest@localhost:5672//') with producers[connection].acquire(block=True) as producer: - # maybe_declare knows what entities have already been declared - # so we don't have to do so multiple times in the same process. - maybe_declare(news_exchange) - producer.publish(article, routing_key='domestic', - serializer='json', - compression='zlib') + producer.publish( + article, + exchange=new_exchange, + routing_key='domestic', + declare=[news_exchange], + serializer='json', + compression='zlib') .. _default-pool-limits: |
