-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-Implement zguide examples in Chumak #11
Comments
Looking for contributors. |
if you could get me an example of actually using chumak in a gen_server, I'd happily help sort ouf the rest of the docs. The examples/ aren't idiomatic for some people, even those experienced in Erlang, to get as far as hello world. |
I haven’t looked into this in a while, so I’m afraid I can’t help. |
I would like to help with this, @mk270 could you tell you mean by idiomatic examples, I have tried the following code example and it is working: The server module is: -module(hwserver).
-export([main/0]).
main() ->
application:start(chumak),
{ok, Socket} = chumak:socket(rep, "my-rep"),
io:format("~p", [Socket]),
{ok, Pid} = chumak:bind(Socket, tcp, "localhost", 5555),
loop(Socket).
loop(Socket) ->
{ok, RecvMessage} = chumak:recv(Socket),
io:format("Received request : ~p\n", [RecvMessage]),
timer:sleep(1000),
chumak:send(Socket, "World"),
loop(Socket).
and the client module is: -module(hwclient).
-export([main/0]).
main() ->
application:start(chumak),
{ok, Socket} = chumak:socket(req, "my-req"),
{ok, Pid} = chumak:connect(Socket, tcp, "localhost", 5555),
loop(Socket).
loop(Socket) ->
chumak:send(Socket, "Hello"),
{ok, RecvMessage} = chumak:recv(Socket),
io:format("Recv Reply: ~p\n", [RecvMessage]),
loop(Socket).
|
@drozzy what is the equivalent of |
@drozzy any idea how to have an |
@shishirpy you may have more luck on Erlang discussion forums: https://www.erlang.org/community I'm not actively maintaining this - I only try to keep up with MRs. |
Re-implement all the zguide Erlang examples in Chumak:
https://github.com/booksbyus/zguide/tree/master/examples
This will serve to document the library and iron out any quirks in the library.
The text was updated successfully, but these errors were encountered: