Skip to content

Commit

Permalink
Add note about resource consumption
Browse files Browse the repository at this point in the history
This bit me not too long ago, and I thought I'd try to make it a bit more visible. With what I think is a very-common configuration, every producer created spawns a new thread that is never released, so `Config.new(...).producer.produce(...)` is a bad thing to be doing.
  • Loading branch information
ben authored Oct 19, 2020
1 parent 532afaa commit b087170
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ end
delivery_handles.each(&:wait)
```

Note that creating a producer consumes some resources that will not be
released until it `#close` is explicitly called, so be sure to call
`Config#producer` only as necessary.

## Development

A Docker Compose file is included to run Kafka and Zookeeper. To run
Expand Down

0 comments on commit b087170

Please sign in to comment.