Skip to content

Commit

Permalink
removed ide related files and review comments fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
varun06 committed Jun 30, 2020
1 parent f51863e commit 8eb2785
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,3 @@ coverage.txt
profile.out

simplest-uncommitted-msg-0.1-jar-with-dependencies.jar

.idea


12 changes: 6 additions & 6 deletions async_producer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1248,21 +1248,21 @@ func ExampleAsyncProducer_select() {
signals := make(chan os.Signal, 1)
signal.Notify(signals, os.Interrupt)

var enqueued, producerError int
var enqueued, producerErrors int
ProducerLoop:
for {
select {
case producer.Input() <- &ProducerMessage{Topic: "my_topic", Key: nil, Value: StringEncoder("testing 123")}:
enqueued++
case err := <-producer.Errors():
log.Println("Failed to produce message", err)
producerError++
producerErrors++
case <-signals:
break ProducerLoop
}
}

log.Printf("Enqueued: %d; producerError: %d\n", enqueued, producerError)
log.Printf("Enqueued: %d; errors: %d\n", enqueued, producerErrors)
}

// This example shows how to use the producer with separate goroutines
Expand All @@ -1283,7 +1283,7 @@ func ExampleAsyncProducer_goroutines() {

var (
wg sync.WaitGroup
enqueued, successes, producerError int
enqueued, successes, producerErrors int
)

wg.Add(1)
Expand All @@ -1299,7 +1299,7 @@ func ExampleAsyncProducer_goroutines() {
defer wg.Done()
for err := range producer.Errors() {
log.Println(err)
producerError++
producerErrors++
}
}()

Expand All @@ -1318,5 +1318,5 @@ ProducerLoop:

wg.Wait()

log.Printf("Successfully produced: %d; producerError: %d\n", successes, producerError)
log.Printf("Successfully produced: %d; errors: %d\n", successes, producerErrors)
}

0 comments on commit 8eb2785

Please sign in to comment.