mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
Add 'supervisor' listening option
If set to 'true' (this is the default), new processes spawned by ejabberd_listener will be attached to the corresponding supervisor. No such processes will be attached to a supervisor otherwise. Setting this to 'false' will improve performance of high loaded systems where new C2S/S2S processes are spawned very rapidly.
This commit is contained in:
parent
dd5389df23
commit
5cfe57ece5
@ -63,8 +63,13 @@
|
|||||||
%%% ejabberd_socket API
|
%%% ejabberd_socket API
|
||||||
%%%===================================================================
|
%%%===================================================================
|
||||||
start(SockData, Opts) ->
|
start(SockData, Opts) ->
|
||||||
|
case proplists:get_value(supervisor, Opts, true) of
|
||||||
|
true ->
|
||||||
|
supervisor:start_child(ejabberd_c2s_sup, [SockData, Opts]);
|
||||||
|
_ ->
|
||||||
xmpp_stream_in:start(?MODULE, [SockData, Opts],
|
xmpp_stream_in:start(?MODULE, [SockData, Opts],
|
||||||
ejabberd_config:fsm_limit_opts(Opts)).
|
ejabberd_config:fsm_limit_opts(Opts))
|
||||||
|
end.
|
||||||
|
|
||||||
start_link(SockData, Opts) ->
|
start_link(SockData, Opts) ->
|
||||||
xmpp_stream_in:start_link(?MODULE, [SockData, Opts],
|
xmpp_stream_in:start_link(?MODULE, [SockData, Opts],
|
||||||
|
@ -55,8 +55,13 @@
|
|||||||
%%% API
|
%%% API
|
||||||
%%%===================================================================
|
%%%===================================================================
|
||||||
start(SockData, Opts) ->
|
start(SockData, Opts) ->
|
||||||
|
case proplists:get_value(supervisor, Opts, true) of
|
||||||
|
true ->
|
||||||
|
supervisor:start_child(ejabberd_s2s_in_sup, [SockData, Opts]);
|
||||||
|
_ ->
|
||||||
xmpp_stream_in:start(?MODULE, [SockData, Opts],
|
xmpp_stream_in:start(?MODULE, [SockData, Opts],
|
||||||
ejabberd_config:fsm_limit_opts(Opts)).
|
ejabberd_config:fsm_limit_opts(Opts))
|
||||||
|
end.
|
||||||
|
|
||||||
start_link(SockData, Opts) ->
|
start_link(SockData, Opts) ->
|
||||||
xmpp_stream_in:start_link(?MODULE, [SockData, Opts],
|
xmpp_stream_in:start_link(?MODULE, [SockData, Opts],
|
||||||
|
@ -53,8 +53,14 @@
|
|||||||
%%% API
|
%%% API
|
||||||
%%%===================================================================
|
%%%===================================================================
|
||||||
start(From, To, Opts) ->
|
start(From, To, Opts) ->
|
||||||
|
case proplists:get_value(supervisor, Opts, true) of
|
||||||
|
true ->
|
||||||
|
supervisor:start_child(ejabberd_s2s_out_sup,
|
||||||
|
[ejabberd_socket, From, To, Opts]);
|
||||||
|
_ ->
|
||||||
xmpp_stream_out:start(?MODULE, [ejabberd_socket, From, To, Opts],
|
xmpp_stream_out:start(?MODULE, [ejabberd_socket, From, To, Opts],
|
||||||
ejabberd_config:fsm_limit_opts([])).
|
ejabberd_config:fsm_limit_opts([]))
|
||||||
|
end.
|
||||||
|
|
||||||
start_link(From, To, Opts) ->
|
start_link(From, To, Opts) ->
|
||||||
xmpp_stream_out:start_link(?MODULE, [ejabberd_socket, From, To, Opts],
|
xmpp_stream_out:start_link(?MODULE, [ejabberd_socket, From, To, Opts],
|
||||||
|
Loading…
Reference in New Issue
Block a user