mirror of
https://github.com/valitydev/machinery-erlang.git
synced 2024-11-06 00:35:19 +00:00
parent
032b66457e
commit
05a77b22c6
5
Makefile
5
Makefile
@ -7,7 +7,10 @@ SUBMODULES = $(UTILS_PATH)
|
||||
SUBTARGETS = $(patsubst %,%/.git,$(SUBMODULES))
|
||||
|
||||
SERVICE_NAME := machinery
|
||||
BUILD_IMAGE_TAG := 0c638a682f4735a65ef232b81ed872ba494574c3
|
||||
BASE_IMAGE_NAME := service-erlang
|
||||
BASE_IMAGE_TAG := 54a794b4875ad79f90dba0a7708190b3b37d584f
|
||||
BUILD_IMAGE_NAME := build-erlang
|
||||
BUILD_IMAGE_TAG := 19ff48ccbe09b00b79303fc6e5c63a3a9f8fd859
|
||||
|
||||
CALL_ANYWHERE := all submodules compile xref lint dialyze clean distclean check_format format
|
||||
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit f42e059d9ec93826ba4ad23232eed8ce67bd5486
|
||||
Subproject commit e1318727d4d0c3e48f5122bf3197158b6695f50e
|
@ -15,7 +15,7 @@ services:
|
||||
condition: service_healthy
|
||||
|
||||
machinegun:
|
||||
image: dr2.rbkmoney.com/rbkmoney/machinegun:c89c2cecc6fa72895492c718f042a7ec90fd2442
|
||||
image: dr2.rbkmoney.com/rbkmoney/machinegun:c35e8a08500fbc2f0f0fa376a145a7324d18a062
|
||||
command: /opt/machinegun/bin/machinegun foreground
|
||||
volumes:
|
||||
- ./test/machinegun/config.yaml:/opt/machinegun/etc/config.yaml
|
||||
|
10
rebar.lock
10
rebar.lock
@ -14,7 +14,7 @@
|
||||
2},
|
||||
{<<"genlib">>,
|
||||
{git,"https://github.com/rbkmoney/genlib.git",
|
||||
{ref,"41920d7774d119c294f3aaba4043ced12da2a815"}},
|
||||
{ref,"4565a8d73f34a0b78cca32c9cd2b97d298bdadf8"}},
|
||||
0},
|
||||
{<<"gproc">>,{pkg,<<"gproc">>,<<"0.8.0">>},1},
|
||||
{<<"hackney">>,{pkg,<<"hackney">>,<<"1.15.2">>},1},
|
||||
@ -26,24 +26,24 @@
|
||||
{<<"metrics">>,{pkg,<<"metrics">>,<<"1.0.1">>},2},
|
||||
{<<"mg_proto">>,
|
||||
{git,"https://github.com/rbkmoney/machinegun_proto.git",
|
||||
{ref,"eac772bb8446fcd2f439232bf10fa086c336aca6"}},
|
||||
{ref,"d814d6948d4ff13f6f41d12c6613f59c805750b2"}},
|
||||
0},
|
||||
{<<"mimerl">>,{pkg,<<"mimerl">>,<<"1.2.0">>},2},
|
||||
{<<"parse_trans">>,{pkg,<<"parse_trans">>,<<"3.3.0">>},3},
|
||||
{<<"ranch">>,{pkg,<<"ranch">>,<<"1.7.1">>},2},
|
||||
{<<"snowflake">>,
|
||||
{git,"https://github.com/rbkmoney/snowflake.git",
|
||||
{ref,"c34a962e17539e63a53f721cbf4ddcffeb0032a4"}},
|
||||
{ref,"7f379ad5e389e1c96389a8d60bae8117965d6a6d"}},
|
||||
1},
|
||||
{<<"ssl_verify_fun">>,{pkg,<<"ssl_verify_fun">>,<<"1.1.5">>},2},
|
||||
{<<"thrift">>,
|
||||
{git,"https://github.com/rbkmoney/thrift_erlang.git",
|
||||
{ref,"d393ef9cdb10f3d761ba3a603df2b2929dc19a10"}},
|
||||
{ref,"846a0819d9b6d09d0c31f160e33a78dbad2067b4"}},
|
||||
1},
|
||||
{<<"unicode_util_compat">>,{pkg,<<"unicode_util_compat">>,<<"0.4.1">>},3},
|
||||
{<<"woody">>,
|
||||
{git,"https://github.com/rbkmoney/woody_erlang.git",
|
||||
{ref,"ae8e7a9f6fa8a331c522e1e2e32271ef6ee0a98e"}},
|
||||
{ref,"58f56b462429ab1fee65e1bdb34b73512406ba00"}},
|
||||
0}]}.
|
||||
[
|
||||
{pkg_hash,[
|
||||
|
@ -191,7 +191,7 @@ get(NS, Ref, Range, Opts) ->
|
||||
('ProcessRepair', woody:args(), woody_context:ctx(), backend_handler_opts()) ->
|
||||
{ok, mg_proto_state_processing_thrift:'RepairResult'()}.
|
||||
handle_function('ProcessSignal', FunctionArgs, WoodyCtx, Opts) ->
|
||||
[#mg_stateproc_SignalArgs{signal = MarshaledSignal, machine = MarshaledMachine}] = FunctionArgs,
|
||||
{#mg_stateproc_SignalArgs{signal = MarshaledSignal, machine = MarshaledMachine}} = FunctionArgs,
|
||||
#{handler := Handler, schema := Schema} = Opts,
|
||||
{Machine, SContext0} = unmarshal({machine, Schema}, MarshaledMachine),
|
||||
{Signal, SContext1} = unmarshal({signal, Schema, SContext0}, MarshaledSignal),
|
||||
@ -203,7 +203,7 @@ handle_function('ProcessSignal', FunctionArgs, WoodyCtx, Opts) ->
|
||||
),
|
||||
{ok, marshal({signal_result, Schema, SContext1}, handle_result(Result, Machine))};
|
||||
handle_function('ProcessCall', FunctionArgs, WoodyCtx, Opts) ->
|
||||
[#mg_stateproc_CallArgs{arg = MarshaledArgs, machine = MarshaledMachine}] = FunctionArgs,
|
||||
{#mg_stateproc_CallArgs{arg = MarshaledArgs, machine = MarshaledMachine}} = FunctionArgs,
|
||||
#{handler := Handler, schema := Schema} = Opts,
|
||||
{Machine, SContext0} = unmarshal({machine, Schema}, MarshaledMachine),
|
||||
{Args, SContext1} = unmarshal({schema, Schema, {args, call}, SContext0}, MarshaledArgs),
|
||||
@ -215,7 +215,7 @@ handle_function('ProcessCall', FunctionArgs, WoodyCtx, Opts) ->
|
||||
),
|
||||
{ok, marshal({call_result, Schema, SContext1}, {Response, handle_result(Result, Machine)})};
|
||||
handle_function('ProcessRepair', FunctionArgs, WoodyCtx, Opts) ->
|
||||
[#mg_stateproc_RepairArgs{arg = MarshaledArgs, machine = MarshaledMachine}] = FunctionArgs,
|
||||
{#mg_stateproc_RepairArgs{arg = MarshaledArgs, machine = MarshaledMachine}} = FunctionArgs,
|
||||
#{handler := Handler, schema := Schema} = Opts,
|
||||
{Machine, SContext0} = unmarshal({machine, Schema}, MarshaledMachine),
|
||||
{Args, SContext1} = unmarshal({schema, Schema, {args, repair}, SContext0}, MarshaledArgs),
|
||||
|
@ -105,6 +105,9 @@ modernize(Descriptor, Client) ->
|
||||
|
||||
%% Internal functions
|
||||
|
||||
issue_call(Function, Args, {WoodyClient, WoodyCtx}) when is_list(Args) ->
|
||||
ArgsTuple = list_to_tuple(Args),
|
||||
issue_call(Function, ArgsTuple, {WoodyClient, WoodyCtx});
|
||||
issue_call(Function, Args, {WoodyClient, WoodyCtx}) ->
|
||||
Service = {mg_proto_state_processing_thrift, 'Automaton'},
|
||||
Request = {Service, Function, Args},
|
||||
|
@ -109,7 +109,7 @@ modernize(NS, Ref, Range, Opts) ->
|
||||
|
||||
-spec handle_function('ModernizeEvent', woody:args(), woody_context:ctx(), backend_handler_opts()) ->
|
||||
{ok, mg_proto_state_processing_thrift:'ModernizeEventResult'()}.
|
||||
handle_function('ModernizeEvent', [MachineEvent0], _WoodyCtx, #{schema := Schema}) ->
|
||||
handle_function('ModernizeEvent', {MachineEvent0}, _WoodyCtx, #{schema := Schema}) ->
|
||||
{MachineEvent, Context} = unmarshal_machine_event(Schema, MachineEvent0),
|
||||
TargetVersion = machinery_mg_schema:get_version(Schema, event),
|
||||
EventPayload = marshal_event_content(Schema, TargetVersion, Context, MachineEvent),
|
||||
|
Loading…
Reference in New Issue
Block a user