Skip to content

Commit

Permalink
Add CONNECT proxy support
Browse files Browse the repository at this point in the history
This commit changes the apns_connection process to a gen_statem
as this makes CONNECT support work better due to an increased
number of states.
  • Loading branch information
essen committed Oct 11, 2018
1 parent 017b155 commit 6b792ed
Show file tree
Hide file tree
Showing 4 changed files with 287 additions and 193 deletions.
5 changes: 4 additions & 1 deletion elvis.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
[#{dirs => ["src", "test"],
filter => "*.erl",
ruleset => erl_files,
rules => [{elvis_style, line_length, #{limit => 100}}]
rules => [
{elvis_style, line_length, #{limit => 100}}
, {elvis_style, god_modules, #{limit => 25, ignore => [apns_connection]}}
]
},
#{dirs => ["."],
filter => "Makefile",
Expand Down
4 changes: 2 additions & 2 deletions src/apns.erl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ stop() ->

%% @doc Connects to APNs service with Provider Certificate or Token
-spec connect( apns_connection:type(), apns_connection:name()) ->
{ok, pid()} | {error, timeout}.
{ok, pid()}.
connect(Type, ConnectionName) ->
DefaultConnection = apns_connection:default_connection(Type, ConnectionName),
connect(DefaultConnection).
Expand All @@ -88,7 +88,7 @@ connect(Connection) ->
apns_sup:create_connection(Connection).

%% @doc Wait for the APNs connection to be up.
-spec wait_for_connection_up(pid()) -> ok | {error, timeout}.
-spec wait_for_connection_up(pid()) -> ok.
wait_for_connection_up(Server) ->
apns_connection:wait_apns_connection_up(Server).

Expand Down
Loading

0 comments on commit 6b792ed

Please sign in to comment.