Last active
February 8, 2016 14:32
-
-
Save dasch/bf019dcdd0aa29c6158e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.