Skip to content

Readmefix1#355

Merged
Magnus Edenhill (edenhill) merged 5 commits into
masterfrom
readmefix1
Apr 18, 2018
Merged

Readmefix1#355
Magnus Edenhill (edenhill) merged 5 commits into
masterfrom
readmefix1

Conversation

@edenhill

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread README.md Outdated

for data in some_data_source:
p.produce('mytopic', data.encode('utf-8'))
# Trigger delivery report callbacks from previous produce() calls

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe 'trigger any available delivery report callbacks from previous produce calls'.

Comment thread README.md Outdated
# Trigger delivery report callbacks from previous produce() calls
p.poll(0)

# Asynchronously produce a message, the optional but recommended

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd remove 'but recommended'.

Also, I think you should 1. explicitly say under exactly what conditions poll is required and 2. explicitly say that if it's not called, messages will pile up indefinitely. My understanding is that errors are also exposed via the same queue, so poll should be called regardless of whether delivery reports are enabled. Is that right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't register an error callback there will be no error events so you don't need to call poll() for that purpose.
We unfortunately can't do the same with delivery reports since they can be set on a per-produce() call basis.

But I don't want to flesh out this example too much, I think I'll go with using a delivery report callback and not speaking of that it is optional. People should be interested in knowing their messages are actually delivered.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, the pr's a step forward so i'm fine to merge. a point here is that by exposing poll, all of these details are also effectively exposed, whereas if the poll call is managed by the producer, they are effectively encapsulated inside the producer - another reason why not having a manual poll api (if it were possible) would reduce complexity considerably.

@mhowlett

Copy link
Copy Markdown
Contributor

Aside from clarifying the comments around poll, LGTM. Happy to re-review them.

Didn't spot anything wrong with the header dict support implementation, and you have tests.

@edenhill Magnus Edenhill (edenhill) merged commit 44e6e63 into master Apr 18, 2018
@edenhill Magnus Edenhill (edenhill) deleted the readmefix1 branch April 18, 2018 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants