diff options
author | Alexey Shchepin <alexey@process-one.net> | 2013-07-08 10:40:39 +0300 |
---|---|---|
committer | Alexey Shchepin <alexey@process-one.net> | 2013-07-08 10:40:39 +0300 |
commit | b5623d6bee414d7236adaf49d8abc698ce74e7d4 (patch) | |
tree | bb5f31732c449ebbb99edf542d4ae4e4ae4042cb /src | |
parent | Cleanup the test suite (just a little) (diff) |
gen_iq_handler:check_type was missing
Diffstat (limited to 'src')
-rw-r--r-- | src/gen_iq_handler.erl | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gen_iq_handler.erl b/src/gen_iq_handler.erl index fd14114ff..d53971fe4 100644 --- a/src/gen_iq_handler.erl +++ b/src/gen_iq_handler.erl @@ -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 %%==================================================================== |