travelping / hello

Erlang RPC server framework
MIT License
31 stars 20 forks source link

Add server side notifications for zmq transport #88

Closed surik closed 8 years ago

surik commented 8 years ago

1) Sending notification from server:

handle_request(Context, _Fun, _Params, State) ->
    hello_handler:notify(Context, Event),
    {reply, {ok, ok}, State}.

2) Receiving notifications on client side:

F = fun(Event) -> io:format("Event = ~p~n", [Event]),
hello_client:start_supervised(client_name,
                              "zmq-tcp://127.0.0.1:8088/test",
                              [], [{notification_sink, F}], []),

Note: it works only over zmq+json-rpc