Code Monkey home page Code Monkey logo

zeromq-crystal's Introduction

zeromq

Build status

Bindings for ZeroMQ (http://zero.mq) Ported from (https://github.com/chuckremes/ffi-rzmq-core) Thank you @chuckremes

Installation

Add this to your application's shard.yml:

dependencies:
  zeromq:
    github: crystal-community/zeromq-crystal

Usage

require "zeromq"
# Simple server
context = ZMQ::Context.new
server = context.socket(ZMQ::REP)
server.bind("tcp://127.0.0.1:5555")

loop do
    puts server.receive_string
    server.send_string("Got it")
end

# Simple client
context = ZMQ::Context.new
client = context.socket(ZMQ::REQ)
client.connect("tcp://127.0.0.1:5555")

client.send_string("Fetch")
puts client.receive_string

TODO

  • Add more tests
  • Add more examples

Contributing

  1. Fork it ( https://github.com/benoist/zeromq-crystal/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

zeromq-crystal's People

Contributors

bcardiff avatar benoist avatar blitline-dev avatar digitalextremist avatar k-solutions avatar romainfranceschini avatar veelenga avatar washu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

zeromq-crystal's Issues

Crystal 0.33.0 compatibility.

There was a breaking change in 0.33.0 of Crystal, at first glance revolving around #each being an undefined method on Crystal::ThreadLocalValue(Crystal::Event) in #close of ZMQ::Socket

Some examples seem to hang

I am running Crystal 0.35.1 on Arch.

I cloned this repository and ran each of the examples. The following files hang on my machine after printing their startup logs.

  • async_client_server.cr
  • push_pull.cr

The same is true of the example in README.md. I also tried installing the shard and using require "zeromq"; the same examples did not work.

The other examples all work fine. I'm sorry I can't offer any actual debugging yet but I'm new to 0MQ, let alone this library.

ZMQ::Poller.deregister

Need ZMQ::Poller.deregister method.

( I will add this, posting as reminder to self. )

Evented IO

Does this library work with crystal's evented IO? i.e. Switching to other fibers when reading is blocked, or does it only provide Poll?

Does not compile with Cystal 1.0

There is a problem using latest crystal:

Unable to satisfy the following requirements:

  • crystal (< 1.0.0) required by zeromq 0.3.0+git.commit.d6d25ace3376aa0f36a6432ed88d35930d3640fb
    Failed to resolve dependencies, try updating incompatible shards or use --ignore-crystal-version as a workaround if no update is available.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.