diff --git a/.github/workflows/erlang.yml b/.github/workflows/erlang.yml index 5da81b5..6bab87e 100644 --- a/.github/workflows/erlang.yml +++ b/.github/workflows/erlang.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: - otp: ['24', '25', '26'] + otp: ['25', '26'] rebar: ['3.22'] steps: diff --git a/README.md b/README.md index 2e5247a..2d0ea69 100644 --- a/README.md +++ b/README.md @@ -132,4 +132,4 @@ Worker Pool is available on [Hex.pm](https://hex.pm/packages/worker_pool). ## Requirements -**Required OTP version 24** or higher. We only provide guarantees that the system runs on `OTP24+` since that's what we're testing it in, but the `minimum_otp_vsn` is `"21"` because some systems where **worker_pool** is integrated do require it. +**Required OTP version 25** or higher. We only provide guarantees that the system runs on `OTP25+` since that's what we're testing it in, but the `minimum_otp_vsn` is `"21"` because some systems where **worker_pool** is integrated do require it. diff --git a/src/wpool.erl b/src/wpool.erl index 34f7e84..662054c 100644 --- a/src/wpool.erl +++ b/src/wpool.erl @@ -70,18 +70,6 @@ -export([stats/0, stats/1, get_workers/1]). -export([default_strategy/0]). --if(?OTP_RELEASE >= 25). - --type gen_server_request_id() :: gen_server:request_id(). - --else. - --type gen_server_request_id() :: reference(). - --endif. - --elvis([{elvis_style, export_used_types, disable}]). - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% ADMIN API %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -206,20 +194,20 @@ cast(Sup, Cast, Strategy) -> wpool_pool:Strategy(Sup), Cast). %% @equiv send_request(Sup, Call, default_strategy(), 5000) --spec send_request(name(), term()) -> noproc | timeout | gen_server_request_id(). +-spec send_request(name(), term()) -> noproc | timeout | gen_server:request_id(). send_request(Sup, Call) -> send_request(Sup, Call, default_strategy()). %% @equiv send_request(Sup, Call, Strategy, 5000) -spec send_request(name(), term(), strategy()) -> - noproc | timeout | gen_server_request_id(). + noproc | timeout | gen_server:request_id(). send_request(Sup, Call, Strategy) -> send_request(Sup, Call, Strategy, 5000). %% @doc Picks a server and issues the call to it. %% Timeout applies only for the time used choosing a worker in the available_worker strategy -spec send_request(name(), term(), strategy(), timeout()) -> - noproc | timeout | gen_server_request_id(). + noproc | timeout | gen_server:request_id(). send_request(Sup, Call, available_worker, Timeout) -> wpool_pool:send_request_available_worker(Sup, Call, Timeout); send_request(Sup, Call, {hash_worker, HashKey}, _Timeout) -> diff --git a/src/wpool_pool.erl b/src/wpool_pool.erl index 725d077..0f494e9 100644 --- a/src/wpool_pool.erl +++ b/src/wpool_pool.erl @@ -43,18 +43,6 @@ -export_type([wpool/0]). --if(?OTP_RELEASE >= 25). - --type gen_server_request_id() :: gen_server:request_id(). - --else. - --type gen_server_request_id() :: reference(). - --endif. - --elvis([{elvis_style, export_used_types, disable}]). - %% =================================================================== %% API functions %% =================================================================== @@ -136,7 +124,7 @@ call_available_worker(Name, Call, Timeout) -> %% @doc Picks the first available worker and sends the request to it. %% The timeout provided considers only the time it takes to get a worker -spec send_request_available_worker(wpool:name(), any(), timeout()) -> - noproc | timeout | gen_server_request_id(). + noproc | timeout | gen_server:request_id(). send_request_available_worker(Name, Call, Timeout) -> wpool_queue_manager:send_request_available_worker(queue_manager_name(Name), Call, diff --git a/src/wpool_queue_manager.erl b/src/wpool_queue_manager.erl index f87ef61..69074fd 100644 --- a/src/wpool_queue_manager.erl +++ b/src/wpool_queue_manager.erl @@ -34,7 +34,7 @@ -export_type([state/0]). --type from() :: {pid(), gen_server_reply_tag()}. +-type from() :: {pid(), gen_server:reply_tag()}. -export_type([from/0]). @@ -60,20 +60,6 @@ -export_type([call_request/0]). -export_type([queue_mgr/0, queue_type/0]). --if(?OTP_RELEASE >= 25). - --type gen_server_request_id() :: gen_server:request_id(). --type gen_server_reply_tag() :: gen_server:reply_tag(). - --else. - --type gen_server_request_id() :: reference(). --type gen_server_reply_tag() :: reference(). - --endif. - --elvis([{elvis_style, export_used_types, disable}]). - %%%=================================================================== %%% API %%%=================================================================== @@ -110,7 +96,7 @@ cast_to_available_worker(QueueManager, Cast) -> %% @doc returns the first available worker in the pool -spec send_request_available_worker(queue_mgr(), any(), timeout()) -> - noproc | timeout | gen_server_request_id(). + noproc | timeout | gen_server:request_id(). send_request_available_worker(QueueManager, Call, Timeout) -> case get_available_worker(QueueManager, Call, Timeout) of {ok, _TimeLeft, Worker} ->