gen_iq_handler:check_type was missing

This commit is contained in:
Alexey Shchepin 2013-07-08 10:40:39 +03:00
parent e89f0f6461
commit b5623d6bee
1 changed files with 12 additions and 1 deletions

View File

@ -33,7 +33,7 @@
%% API
-export([start_link/3, add_iq_handler/6,
remove_iq_handler/3, stop_iq_handler/3, handle/7,
process_iq/6]).
process_iq/6, check_type/1]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2,
@ -45,6 +45,10 @@
-record(state, {host, module, function}).
-type component() :: ejabberd_sm | ejabberd_local.
-type type() :: no_queue | one_queue | {queues, pos_integer()} | parallel.
-type opts() :: no_queue | {one_queue, pid()} | {queues, [pid()]} | parallel.
%%====================================================================
%% API
%%====================================================================
@ -122,6 +126,13 @@ process_iq(_Host, Module, Function, From, To, IQ) ->
end
end.
-spec check_type(type()) -> type().
check_type(no_queue) -> no_queue;
check_type(one_queue) -> one_queue;
check_type({queues, N}) when is_integer(N), N>0 -> {queues, N};
check_type(parallel) -> parallel.
%%====================================================================
%% gen_server callbacks
%%====================================================================