Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions config/prd/sys.config
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,6 @@
{erlbin_number, 15}
]},

{lager,
[
{log_root, "log"},
%% Default handlers for lager/lager_event
{handlers,
[
{lager_console_backend, debug}
]},

%% Any other sinks
{extra_sinks,
[
{audit_lager_event,
[{handlers,
[
{lager_console_backend, debug}
]
},
{async_threshold, 500},
{async_threshold_window, 50}]
}]
}
]},

{kernel, [{
logger,
Expand Down
Binary file removed epo
Binary file not shown.
7 changes: 0 additions & 7 deletions key.priv

This file was deleted.

6 changes: 0 additions & 6 deletions key.pub

This file was deleted.

Binary file removed priv/lang/wamp_service.en.mo
Binary file not shown.
37 changes: 0 additions & 37 deletions priv/lang/wamp_service.en.po

This file was deleted.

Binary file removed priv/lang/wamp_service.es_AR.mo
Binary file not shown.
37 changes: 0 additions & 37 deletions priv/lang/wamp_service.es_AR.po

This file was deleted.

31 changes: 0 additions & 31 deletions priv/lang/wamp_service.pot

This file was deleted.

39 changes: 19 additions & 20 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
{erl_opts,
[debug_info,
{parse_transform, lager_transform},
{parse_transform, epo_gettext},
{gettext, wamp_service_compiled_po}
{minimum_otp_vsn, "23.0"}.

{erl_opts,[
debug_info
]}.

{deps,
[{wamper, {git, "https://github.com/frepond/wamper.git", {branch, "master"}}},
[
msgpack,
{pbkdf2, {git, "https://github.com/pma/erlang-pbkdf2", {branch, "master"}}},
{jsx, {git, "https://github.com/talentdeficit/jsx.git", {tag, "2.8.2"}}},
{awre, {git, "https://github.com/frepond/awre.git", {branch, "master"}}},
{lager , {git, "https://github.com/erlang-lager/lager.git", {tag, "3.6.4"}}},
{epo_runtime, {git, "https://github.com/brigadier/epo_runtime.git", {branch, "master"}}},
{backoff, {git, "https://github.com/ferd/backoff.git", {branch, master}}}
{pbkdf2,
{git, "https://github.com/leapsight-oss/erlang-pbkdf2.git", {branch, "master"}}
},
jsone,
{awre, {git, "https://github.com/leapsight/awre.git", {branch, "master"}}},
{wamper, {git, "https://github.com/leapsight/wamper.git", {branch, "master"}}},
backoff
]}.

{relx,
[{release, {wamp_service, "0.5.0" },
[{release, {wamp_service, "0.6.0" },
[kernel,
stdlib,
sasl,
%% --------------
lager,
jsx,
jsone,
msgpack,
pbkdf2,
epo_runtime,
wamper,
awre,
backoff,
Expand Down Expand Up @@ -84,18 +82,19 @@
]},
{test,
[{deps, [meck]},
{erl_opts, [debug_info, export_all]}
{erl_opts, [debug_info, export_all]},
{sys_config, "./config/dev/sys.config"}
]}
]}.

{ct_opts, [{sys_config, "config/dev/sys.config"}]}.

{plugins, [rebar3_auto]}.

{shell, [{config, "config/dev/sys.config"}, {apps, [sasl, lager, msgpack, pbkdf2, jsx, wamper, awre, wamp_service]}]}.
{shell, [{config, "config/dev/sys.config"}, {apps, [sasl, msgpack, pbkdf2, jsone, wamper, awre, wamp_service]}]}.

{elvis,
[#{dirs => ["apps/accounts/src"],
[#{dirs => ["src"],
filter => "*.erl",
rules => [
%% {elvis_style, line_length,
Expand Down Expand Up @@ -141,7 +140,7 @@
},
#{dirs => ["."],
filter => "rebar.config",
rules => [{elvis_project, no_deps_master_rebar, #{ignore => [awre, wamper, pbkdf2, epo_runtime]}},
rules => [{elvis_project, no_deps_master_rebar, #{ignore => [awre, wamper, pbkdf2]}},
{elvis_project, protocol_for_deps_rebar, #{ignore => []}}]
}
]
Expand Down
44 changes: 17 additions & 27 deletions rebar.lock
Original file line number Diff line number Diff line change
@@ -1,36 +1,26 @@
{"1.1.0",
{"1.2.0",
[{<<"awre">>,
{git,"https://github.com/frepond/awre.git",
{ref,"7ca1a27a4250e0a3caff2288f02195810b164c0c"}},
{git,"https://github.com/leapsight/awre.git",
{ref,"3b39c445e73f2067eb345328d80f6b6aec9d6540"}},
0},
{<<"backoff">>,
{git,"https://github.com/ferd/backoff.git",
{ref,"dfb19a20c37b73af067edc3c335624bdf9517396"}},
0},
{<<"epo_runtime">>,
{git,"https://github.com/brigadier/epo_runtime.git",
{ref,"c403f40237abc93fedfbbed6462f77121bf14be9"}},
0},
{<<"goldrush">>,{pkg,<<"goldrush">>,<<"0.1.9">>},1},
{<<"jsx">>,
{git,"https://github.com/talentdeficit/jsx.git",
{ref,"d4b6d3dc5fd9e759ff7a0c476654ea5124f5bae9"}},
0},
{<<"lager">>,
{git,"https://github.com/erlang-lager/lager.git",
{ref,"bf60290101306b3cc26544d0d181a5cff8931e82"}},
0},
{<<"msgpack">>,{pkg,<<"msgpack">>,<<"0.7.0">>},0},
{<<"backoff">>,{pkg,<<"backoff">>,<<"1.1.6">>},0},
{<<"jsone">>,{pkg,<<"jsone">>,<<"1.8.1">>},0},
{<<"msgpack">>,{pkg,<<"msgpack">>,<<"0.8.1">>},0},
{<<"pbkdf2">>,
{git,"https://github.com/pma/erlang-pbkdf2",
{ref,"93b290d72b107747c717fb1f55811d2ebc1b73ed"}},
{git,"https://github.com/leapsight-oss/erlang-pbkdf2.git",
{ref,"84f964b1875b047c3ad93d43cc350c45d6e27f9c"}},
0},
{<<"wamper">>,
{git,"https://github.com/frepond/wamper.git",
{ref,"b5aa4ac167f5d2fca1af1a0de45a6698711c5903"}},
{git,"https://github.com/leapsight/wamper.git",
{ref,"0d7cc7c2ebd396f0cf1e8d512c708f4d855157d0"}},
0}]}.
[
{pkg_hash,[
{<<"goldrush">>, <<"F06E5D5F1277DA5C413E84D5A2924174182FB108DABB39D5EC548B27424CD106">>},
{<<"msgpack">>, <<"128AE0A2227C7E7A2847C0F0F73551C268464F8C1EE96BFFB920BC0A5712B295">>}]}
{<<"backoff">>, <<"83B72ED2108BA1EE8F7D1C22E0B4A00CFE3593A67DBC792799E8CCE9F42F796B">>},
{<<"jsone">>, <<"6BC74D3863D55D420077346DA97C601711017A057F2FD1DF65D6D65DD562FBAB">>},
{<<"msgpack">>, <<"DEB35C13291EAFE56AD9870374C2EAA92323DC5503D50432EBCAF47052E6D343">>}]},
{pkg_hash_ext,[
{<<"backoff">>, <<"CF0CFFF8995FB20562F822E5CC47D8CCF664C5ECDC26A684CBE85C225F9D7C39">>},
{<<"jsone">>, <<"C78918124148C51A7A84C678E39BBC6281F8CB582F1D88584628A98468E99738">>},
{<<"msgpack">>, <<"04D9A75BC6F4BED8627EE1E7AA9DF37601F510FDC786A84FE932BB21D765565F">>}]}
].
12 changes: 7 additions & 5 deletions src/example/wamp_service_example.erl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
%% Demo service
-module(wamp_service_example).

-include_lib("kernel/include/logger.hrl").

-export([add/3]).
-export([echo/2]).
-export([multiple_results/1]).
Expand All @@ -17,14 +19,14 @@

-spec add(number(), number(), map()) -> number().
add(A, B, _Opts) ->
ok = lager:debug("add called, sent ~p + ~p.", [A, B]),
ok = ?LOG_DEBUG("add called, sent ~p + ~p.", [A, B]),
A + B.

-spec echo(any(), map()) -> any().
echo(Msg, _Opts) ->
ok = lager:debug("echo called..."),
ok = ?LOG_DEBUG("echo called..."),
timer:sleep(2500),
ok = lager:debug("echo sent ~p.", [Msg]),
ok = ?LOG_DEBUG("echo sent ~p.", [Msg]),
Msg.

-spec multiple_results(map()) -> list().
Expand Down Expand Up @@ -73,9 +75,9 @@ timeout(_Opts) ->

-spec onhello(any(), map()) -> ok.
onhello(Msg, _Opts) ->
ok = lager:debug("event from com.example.onhello ~p.", [Msg]),
ok = ?LOG_DEBUG("event from com.example.onhello ~p.", [Msg]),
ok.

onadd(A, B, _Opts) ->
ok = lager:debug("event from com.example.onadd ~p.", [A + B]),
ok = ?LOG_DEBUG("event from com.example.onadd ~p.", [A + B]),
ok.
3 changes: 1 addition & 2 deletions src/wamp_service.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
[kernel,
stdlib,
sasl,
lager,
jsx,
jsone,
msgpack,
pbkdf2,
wamper,
Expand Down
23 changes: 14 additions & 9 deletions src/wamp_service.erl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

-module(wamp_service).

-include_lib("kernel/include/logger.hrl").

-define(DELTA, 100).

-export([call/3, call/4, maybe_error/1, publish/3, register/3, register/4, unregister/1, status/0]).
Expand All @@ -22,17 +24,20 @@ call(Uri, Args, ArgsKw, Timeout)
try
WampRes = gen_server:call(wamp_caller, {call, Uri, Args, ArgsKw, Timeout}, Timeout + 100),
case WampRes of
{ok, _, [Res], _} ->
_ = lager:debug("call uri=~p result=~p", [Uri, Res]),
{ok, Res};
{ok, _, [], _} ->
_ = lager:debug("call uri=~p result=~p", [Uri, undefined]),
{ok, _, undefined, _RKWArgs} ->
_ = ?LOG_DEBUG("call uri=~p result=~p", [Uri, undefined]),
{ok, undefined};
{ok, _, [], _RKWArgs} ->
_ = ?LOG_DEBUG("call uri=~p result=~p", [Uri, undefined]),
{ok, undefined};
{ok, _, Res = [_, _ | _], _} ->
_ = lager:debug("call uri=~p result=~p", [Uri, Res]),
{ok, Res};
{ok, _, [Arg], _RKWArgs} ->
_ = ?LOG_DEBUG("call uri=~p result=~p", [Uri, Arg]),
{ok, Arg};
{ok, _, RArgs, _RKWArgs} ->
_ = ?LOG_DEBUG("call uri=~p result=~p", [Uri, RArgs]),
{ok, RArgs};
{error, _, Key, _, Map} ->
_ = lager:debug("call uri=~p key=~p error=~p", [Uri, Key, Map]),
_ = ?LOG_DEBUG("call uri=~p key=~p error=~p", [Uri, Key, Map]),
{error, Key, Map}
end
catch
Expand Down
Loading