infinity
This commit is contained in:
parent
53883ae188
commit
7a9c30c2d1
|
@ -86,7 +86,8 @@ lookup(ClientId) when is_binary(ClientId) ->
|
||||||
%%------------------------------------------------------------------------------
|
%%------------------------------------------------------------------------------
|
||||||
-spec register(ClientId :: binary(), Pid :: pid()) -> ok.
|
-spec register(ClientId :: binary(), Pid :: pid()) -> ok.
|
||||||
register(ClientId, Pid) when is_binary(ClientId), is_pid(Pid) ->
|
register(ClientId, Pid) when is_binary(ClientId), is_pid(Pid) ->
|
||||||
gen_server:call(?SERVER, {register, ClientId, Pid}).
|
%%TODO: infinify to block requests when too many clients, this will be redesinged in 0.9.x...
|
||||||
|
gen_server:call(?SERVER, {register, ClientId, Pid}, infinity).
|
||||||
|
|
||||||
%%------------------------------------------------------------------------------
|
%%------------------------------------------------------------------------------
|
||||||
%% @doc
|
%% @doc
|
||||||
|
|
|
@ -119,8 +119,12 @@ create(Topic) ->
|
||||||
subscribe({Topic, Qos}, SubPid) when is_binary(Topic) and is_pid(SubPid) ->
|
subscribe({Topic, Qos}, SubPid) when is_binary(Topic) and is_pid(SubPid) ->
|
||||||
subscribe([{Topic, Qos}], SubPid);
|
subscribe([{Topic, Qos}], SubPid);
|
||||||
|
|
||||||
|
%% TODO:
|
||||||
|
%% call will not work when there are 2000K+ clients, 100+ sub requests/sec...
|
||||||
|
%% will optimize in 0.9.x...
|
||||||
|
%%
|
||||||
subscribe(Topics, SubPid) when is_list(Topics) and is_pid(SubPid) ->
|
subscribe(Topics, SubPid) when is_list(Topics) and is_pid(SubPid) ->
|
||||||
gen_server:call(?SERVER, {subscribe, Topics, SubPid}).
|
gen_server:call(?SERVER, {subscribe, Topics, SubPid}, infinity).
|
||||||
|
|
||||||
%%------------------------------------------------------------------------------
|
%%------------------------------------------------------------------------------
|
||||||
%% @doc
|
%% @doc
|
||||||
|
|
Loading…
Reference in New Issue