Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Dialyzer behaviour/callback optimizations for newer Erlang releases #38

Merged
merged 2 commits into from

2 participants

@drobakowski

To get rid of dialyzer errors like "Callback info about the poolboy_worker behaviour is not available" the new module attribute "-callback" (introduced with the Erlang release R15) should be used for behaviors instead of "behaviour_info/1". This pull request does not break any code compiled with Erlang releases prior to R15.

@devinus
Owner

@drobakowski I like going to the new -callback behaviour, but Poolboy will be dropping support for pre-R15 releases like riak_core, so I think we can just safely go to -callback now.

@drobakowski

@devinus sounds good to me, i'll prepare an additional commit with -callback only and push it back to synlay:feature/behaviour_callback_refactoring and this pull request.

@drobakowski drobakowski Replaced behaviour_info/1 with new -callback specs
WARNING: this commit breaks compatibility with
         Erlang releases prior to R15
5bbfc1a
@devinus devinus merged commit d47df5d into devinus:master

1 check passed

Details default The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 9, 2014
  1. @drobakowski
Commits on Jan 14, 2014
  1. @drobakowski

    Replaced behaviour_info/1 with new -callback specs

    drobakowski authored
    WARNING: this commit breaks compatibility with
             Erlang releases prior to R15
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/poolboy_worker.erl
View
12 src/poolboy_worker.erl
@@ -2,9 +2,9 @@
-module(poolboy_worker).
--export([behaviour_info/1]).
-
-behaviour_info(callbacks) ->
- [{start_link, 1}];
-behaviour_info(_Other) ->
- undefined.
+-callback start_link(WorkerArgs) -> {ok, Pid} |
+ {error, {already_started, Pid}} |
+ {error, Reason} when
+ WorkerArgs :: proplists:proplist(),
+ Pid :: pid(),
+ Reason :: term().
Something went wrong with that request. Please try again.