This file contains 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
/* | |
For readersCount == 4, you might see 4 "added reader" (0 through 3) or just one, or three, etc. Like it's blocking somewhere... The readers that do initialize process messages just fine. All of the nsqlookupd hosts respond to /ping. | |
*/ | |
for i := 0; i < readersCount; i++ { | |
r, err := nsq.NewReader(topic, channel) | |
if err != nil { | |
log.Fatalln("nsq.NewReader:", err) |
This file contains 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
class Hash | |
def with(&block) | |
block.call *block.parameters.map{|x| self[x.last]} | |
end | |
end | |
# Example | |
h = {:name => "blambeau", :hobby => "ruby"} |