Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 5 additions and 6 deletions.
  1. +5 −6 src/stetson_server.erl
View
11 src/stetson_server.erl
@@ -80,6 +80,9 @@ handle_cast({Type, Bucket, N}, State) ->
{noreply, State};
handle_cast({Type, Bucket, N, Rate}, State) ->
ok = stat(State, Type, Bucket, N, Rate),
+ {noreply, State};
+handle_cast(Msg, State) ->
+ error_logger:warning_msg("Unhandled cast to stetson_server: ~p",[Msg]),
{noreply, State}.
-spec handle_info(_Info, #s{}) -> {noreply, #s{}}.
@@ -123,12 +126,8 @@ stat(State, timer, Bucket, N) ->
%% @private Send the formatted binary packet over the udp socket,
%% prepending the ns/namespace
send(#s{sock = Sock, host = Host, port = Port, ns = Ns}, Format, Args) ->
- %% iolist_to_bin even though gen_...:send variants accept deep iolists,
- %% since it makes logging and testing easier
- Msg = iolist_to_binary(io_lib:format("~s." ++ Format, [Ns|Args])),
- case gen_udp:send(Sock, Host, Port, Msg) of
- _Any -> ok
- end.
+ Msg = io_lib:format("~s." ++ Format, [Ns|Args]),
+ gen_udp:send(Sock, Host, Port, Msg).
-spec split_uri(string(), inet:port_number()) -> {nonempty_string(), inet:port_number()}.
%% @private

No commit comments for this range

Something went wrong with that request. Please try again.