Skip to content

Instantly share code, notes, and snippets.

@dasch
Last active February 8, 2016 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dasch/bf019dcdd0aa29c6158e to your computer and use it in GitHub Desktop.
Save dasch/bf019dcdd0aa29c6158e to your computer and use it in GitHub Desktop.
require "kafka"
# Current:
cluster = Kafka.new(seed_brokers: [...], client_id: "test", socket_timeout: 1)
producer = kafka.get_producer(required_acks: 2, ack_timeout: 2)
# Suggested:
cluster = Kafka::Cluster.new(seed_brokers: [...], client_id: "test", socket_timeout: 1)
producer = Kafka::Producer.new(cluster: cluster, required_acks: 2, ack_timeout: 2)
# Alternative:
producer = Kafka::Producer.new(
seed_brokers: [...],
client_id: "test",
socket_timeout: 1,
required_acks: 2,
ack_timeout: 2
)
@dasch
Copy link
Author

dasch commented Feb 8, 2016

Maybe the last example is preferable – it leaves just a single top-level API to document. When Consumer is added that would be a totally separate top-level API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment