booksbyus / zguide

Learning and Using ØMQ

Home Page:http://zguide.zeromq.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Crystal examples, and in the process refactor the Ruby ones.

digitalextremist opened this issue · comments

commented

Noticed while referencing the MDP examples that they are in need of refactoring to not confuse, or continue mistakes. Just two examples, unless I am mistaken:

This is the only place where @expect_reply exists, meaning it's essentially unused, and an artifact from copying and pasting another example:

Then in the same file, instance variables are set for what ought to just be constants on the class, such as @timeout vs. TIMEOUT or @reconnect vs. RECONNECT, etc.

But I found these examples by using Ruby code to demonstrate patterns I was transposing as Crystal. Rather than refactor Ruby for its own sake, it would make more sense to add Crystal examples made from the Ruby ones, and just know that refactoring will also be involved.

Adding an issue in hopes of coming back later myself, and making a contribution. Have loved 0MQ for ages now, and am grateful that Hintjens lives on so presently, not only in the guide on my desk, but in the movement which only needs updated language examples over time.