Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need better documentation for 'ezwebframe' #18

Open
ptmoy2 opened this issue Jan 1, 2016 · 0 comments
Open

Need better documentation for 'ezwebframe' #18

ptmoy2 opened this issue Jan 1, 2016 · 0 comments

Comments

@ptmoy2
Copy link

ptmoy2 commented Jan 1, 2016

I understand the explanations in the book, but am having difficulty understanding the code in ezwebframe.erl. One problem is the seemingly inconsistency between some of the 'cowboy'-related function calls in ezwebframe and documentation found in the cowboy website. For example:

For websockets, Cowboy website says:

   First, the init/3 callback is called. This callback is common to all handlers. To establish a 
   Websocket connection, this function must return an upgrade tuple.

   init(_, Req, Opts) -> {upgrade, protocol, cowboy_websocket}.
        or
   init(_Type, Req, Opts) -> {upgrade, protocol, cowboy_websocket, Req, Opts}.

But in ezwebframe.erl, I see init/2 with a return tuple of {cowboy_websocket, Req, Pid}, which I can't find anywhere in the Cowboy documentation. Is this from an older version of Cowboy? This is just one example. There are others.

I've successfully used the Yaws web server for a couple of projects in the past. Yaws worked well and unlike Cowboy, it is very well documented. I'm taking a look at Cowboy only because Joe used it in his book, which in my opinion, gave it some credibility. Also, I read somewhere that Cowboy is supposed to be a bit lighter weight and has better performance (maybe because of the use single precess per connection and binaries). But I'm struggling with it; the documentation is terrible.

Curious as to why Joe chose Cowboy over Yaws for his book.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant