diff options
| author | Dana Powers <dana.powers@gmail.com> | 2018-03-23 05:58:55 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-23 05:58:55 -0700 |
| commit | b62006aeb86258b4b1ef2735bebb1fe99459b82d (patch) | |
| tree | 9a5cab083163b8e5d952d1bb0f3bb7141ffb746a /docs | |
| parent | 204388b0928c02a339eb84b376c74851eb074e69 (diff) | |
| download | kafka-python-b62006aeb86258b4b1ef2735bebb1fe99459b82d.tar.gz | |
Change SimpleProducer to use async_send (async is reserved in py37) (#1454)
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/simple.rst | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/simple.rst b/docs/simple.rst index 8192a8b..afdb975 100644 --- a/docs/simple.rst +++ b/docs/simple.rst @@ -49,7 +49,7 @@ Asynchronous Mode # To send messages asynchronously client = SimpleClient('localhost:9092') - producer = SimpleProducer(client, async=True) + producer = SimpleProducer(client, async_send=True) producer.send_messages('my-topic', b'async message') # To send messages in batch. You can use any of the available @@ -60,7 +60,7 @@ Asynchronous Mode # * If the producer dies before the messages are sent, there will be losses # * Call producer.stop() to send the messages and cleanup producer = SimpleProducer(client, - async=True, + async_send=True, batch_send_every_n=20, batch_send_every_t=60) @@ -73,7 +73,7 @@ Synchronous Mode # To send messages synchronously client = SimpleClient('localhost:9092') - producer = SimpleProducer(client, async=False) + producer = SimpleProducer(client, async_send=False) # Note that the application is responsible for encoding messages to type bytes producer.send_messages('my-topic', b'some message') @@ -88,7 +88,7 @@ Synchronous Mode # ACK_AFTER_CLUSTER_COMMIT : server will block until the message is committed # by all in sync replicas before sending a response producer = SimpleProducer(client, - async=False, + async_send=False, req_acks=SimpleProducer.ACK_AFTER_LOCAL_WRITE, ack_timeout=2000, sync_fail_on_error=False) |
