Skip to content

Commit

Permalink
Removed unnecessary CloseWithContext function.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Yu committed Oct 2, 2017
1 parent 0176c83 commit e8ffae2
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,17 +500,9 @@ func (p *Producer) sendToDataSpill(msg *Message) {
}
}

// CloseWithContext initiates the graceful shutdown of the produce function, waiting for all outstanding messages and to
// flush. Cancellation is supported through contexts.
func (p *Producer) CloseWithContext(ctx context.Context) {
p.shutdown()
<-ctx.Done()
close(p.pipeOfDeath)
}

// Close initiates the graceful shutdown of the produce function, waiting for all outstanding messages and to flush.
func (p *Producer) Close() {
p.CloseWithContext(context.TODO())
p.shutdown()
}

// SendWithContext sends a message to the stream. Cancellation supported through contexts.
Expand Down

0 comments on commit e8ffae2

Please sign in to comment.