zeromq / chumak

Pure Erlang implementation of ZeroMQ Message Transport Protocol.
Mozilla Public License 2.0
197 stars 47 forks source link

Attempting to get contribute, having some issues #9

Closed lawik closed 7 years ago

lawik commented 7 years ago

Hi

I'm trying to look into multipart support as that is the only feature I believe is lacking for me to be able to try using this.

But I come from Elixir so while I grasp most concepts and can figure out most code along the way I'm not very familiar with the tooling. I have no problem running the python samples as I work with Python.

So a few questions that I hope someone has time for :)

Tests do not seem to run

I get this: ===> Verifying dependencies... ===> Compiling chumak ===> Performing EUnit tests...

Finished in 0.284 seconds 0 tests

Similarly the coverage thing reports no coverage.

How do I run a particular example?

I'm trying to run chumak_req.erl but failing :)

Hope you can help get me started.

drozzy commented 7 years ago

Yeah, just like in Elixir where you have iex, in erlang there is rebar3.

Try running this from chumak directory (given that you have erlang 19.2 installed):

./rebar3 shell

From here you can try anything found in examples (albeit running examples requires compiling them - but I won't go into that here - see below first): https://github.com/chovencorp/chumak/tree/master/examples

Alternatively, you can depend on this directly from mix (see mix.exs syntax https://hex.pm/packages/chumak), and just start it as a gen_server from Elixir. Again, see something like:

https://github.com/chovencorp/chumak/blob/master/examples/req_client.erl

From elixir you would add chumak to your supervision tree:

worker(:chumak, [])

and call it as:

{:ok, socket} = :chumak.socket(:req, 'my-req')

(Note that it has to be a charlist for Erlang - something we could potentially transfer to binary strings in the future)

Sorry for the hodge-podge of answers, but please ask anything. Until it is clear! If you can't get it going, I can try creating an elixir skeleton.

lawik commented 7 years ago

Thanks a lot, that should let me proceed, any idea why the rebar3 eunit thing from the docs gives me 0 tests run?

Erlang is quite dense to read but I'll get there :P

drozzy commented 7 years ago

@lawik Good catch. It seems the crypto merge broke the unit test running.

I've fixed it, but note that you won't be able to pass the unit tests for crypto, unless you run with crypto support.

drozzy commented 7 years ago

@lawik Do you mind closing this and re-opening it if you have further issues?

lawik commented 7 years ago

Certainly :)