Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readmefix1 #355

Merged
merged 5 commits into from
Apr 18, 2018
Merged

Readmefix1 #355

merged 5 commits into from
Apr 18, 2018

Conversation

edenhill
Copy link
Contributor

No description provided.

@edenhill edenhill requested a review from mhowlett April 12, 2018 14:46
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
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'.

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

# Asynchronously produce a message, the optional but recommended
Copy link
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
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
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
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 edenhill merged commit 44e6e63 into master Apr 18, 2018
@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.

None yet

2 participants