fix service
This commit is contained in:
parent
a4af3af2e4
commit
c6e1056f44
@ -26,23 +26,17 @@
|
|||||||
%% gen_server callbacks
|
%% gen_server callbacks
|
||||||
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
|
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
|
||||||
|
|
||||||
-export([test/0, test1/0]).
|
|
||||||
|
|
||||||
-record(state, {
|
-record(state, {
|
||||||
service_id :: binary(),
|
service_id :: binary(),
|
||||||
%% 通道id信息
|
%% 通道id信息
|
||||||
channel_pid :: pid() | undefined,
|
channel_pid :: pid() | undefined,
|
||||||
|
|
||||||
%% 当前进程的port信息, OSPid = erlang:port_info(Port, os_pid)
|
%% 当前进程的port信息, OSPid = erlang:port_info(Port, os_pid)
|
||||||
port :: undefined | port(),
|
port :: undefined | port(),
|
||||||
%% 系统对应的pid
|
%% 系统对应的pid
|
||||||
os_pid :: undefined | integer(),
|
os_pid :: undefined | integer(),
|
||||||
|
|
||||||
%% 配置信息
|
%% 配置信息
|
||||||
manifest :: undefined | efka_manifest:manifest(),
|
manifest :: undefined | efka_manifest:manifest(),
|
||||||
|
|
||||||
inflight = #{},
|
inflight = #{},
|
||||||
|
|
||||||
%% 当前服务的运行状态
|
%% 当前服务的运行状态
|
||||||
running_status = ?STATUS_STOPPED
|
running_status = ?STATUS_STOPPED
|
||||||
}).
|
}).
|
||||||
@ -51,14 +45,6 @@
|
|||||||
%%% API
|
%%% API
|
||||||
%%%===================================================================
|
%%%===================================================================
|
||||||
|
|
||||||
test() ->
|
|
||||||
Pid = get_pid(<<"test1234">>),
|
|
||||||
stop_service(Pid).
|
|
||||||
|
|
||||||
test1() ->
|
|
||||||
Pid = get_pid(<<"test1234">>),
|
|
||||||
start_service(Pid).
|
|
||||||
|
|
||||||
-spec get_name(ServiceId :: binary()) -> atom().
|
-spec get_name(ServiceId :: binary()) -> atom().
|
||||||
get_name(ServiceId) when is_binary(ServiceId) ->
|
get_name(ServiceId) when is_binary(ServiceId) ->
|
||||||
list_to_atom("efka_service:" ++ binary_to_list(ServiceId)).
|
list_to_atom("efka_service:" ++ binary_to_list(ServiceId)).
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user