Skip to content

Commit

Permalink
Improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
eapache committed Aug 1, 2014
1 parent c6e70c6 commit 251499f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ func (config *ProducerConfig) Validate() error {

// Producer publishes Kafka messages. It routes messages to the correct broker
// for the provided topic-partition, refreshing metadata as appropriate, and
// parses responses for errors. You must call Close() on a producer to avoid
// parses responses for errors. You must read from the Errors() channel or the
// producer will deadlock. You must call Close() on a producer to avoid
// leaks: it will not be garbage-collected automatically when it passes out of
// scope (this is in addition to calling Close on the underlying client, which
// is still necessary).
Expand Down Expand Up @@ -132,8 +133,8 @@ type ProduceError struct {
Err error
}

// Errors is the output channel back to the user. If you do not read from this channel,
// the Producer may deadlock. It is suggested that you send messages and read errors in a select statement.
// Errors is the output channel back to the user. You MUST read from this channel or the Producer will deadlock.
// It is suggested that you send messages and read errors together in a single select statement.
func (p *Producer) Errors() <-chan *ProduceError {
return p.errors
}
Expand Down

0 comments on commit 251499f

Please sign in to comment.