Skip to content
Browse files

Replaced behaviour_info/1 with new -callback specs

WARNING: this commit breaks compatibility with
         Erlang releases prior to R15
  • Loading branch information...
1 parent ae05fd3 commit 5bbfc1a6cd87489fb435d3f9c479cea3867c4353 @drobakowski drobakowski committed Jan 14, 2014
Showing with 0 additions and 23 deletions.
  1. +0 −10 rebar.config.script
  2. +0 −13 src/poolboy_worker.erl
View
10 rebar.config.script
@@ -1,10 +0,0 @@
-{match, [ErtsNumber]} = re:run(erlang:system_info(otp_release), "R(\\d+).+", [{capture, [1], list}]),
-ErtsVsn = erlang:list_to_integer(ErtsNumber),
-if
- ErtsVsn >= 15 ->
- OldOpts = proplists:get_value(erl_opts, CONFIG, []),
- NewOpts = [{d, have_callback_support} | OldOpts],
- lists:keystore(erl_opts, 1, CONFIG, {erl_opts, NewOpts});
- true ->
- CONFIG
-end.
View
13 src/poolboy_worker.erl
@@ -2,22 +2,9 @@
-module(poolboy_worker).
--ifdef(have_callback_support).
-
-callback start_link(WorkerArgs) -> {ok, Pid} |
{error, {already_started, Pid}} |
{error, Reason} when
WorkerArgs :: proplists:proplist(),
Pid :: pid(),
Reason :: term().
-
--else.
-
--export([behaviour_info/1]).
-
-behaviour_info(callbacks) ->
- [{start_link, 1}];
-behaviour_info(_Other) ->
- undefined.
-
--endif.

0 comments on commit 5bbfc1a

Please sign in to comment.
Something went wrong with that request. Please try again.