Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fix `cowboy:start_http` typespec #484

Merged
merged 1 commit into from Jun 7, 2013

Conversation

Projects
None yet
2 participants
Contributor

erszcz commented Mar 29, 2013

cowboy:start_http calls ranch:start_listener which in turn calls supervisor:start_child. The happy path in fact returns {ok, pid()} but in other situations the call may actually return sth quite different.

Owner

essen commented Apr 11, 2013

While it is true that a supervisor might return something different, this supervisor will only return {ok, pid()} or {error, any()}, not supervisor:startchild_ret/0 then.

Owner

essen commented May 31, 2013

Please update the PR with the above comment in mind, thanks!

Contributor

erszcz commented Jun 1, 2013

cowboy:start_http/4 calls ranch:start_listener/6 which in turn calls supervisor:start_child/2 and stores the result in Res. Res is not filtered/mapped in any way but returned just after a case statement matching on it.

So, the only reason (I see) why the return value might not be supervisor:startchild_ret() might stem from the fact that the started child never returns {ok, Child, Info}. Is that the case?

Owner

essen commented Jun 1, 2013

Yes.

Please make this a single commit and rebase to master, there's been some spec improvements since your first commit.

Thanks!

@essen essen merged commit e4f407e into ninenines:master Jun 7, 2013

Owner

essen commented Jun 7, 2013

Merged! Thanks.

@erszcz erszcz deleted the erszcz:types branch Jun 7, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment