0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-15 04:30:25 +00:00
Commit graph

9 commits

Author SHA1 Message Date
Loïc Hoguin
58e9e76814
Fix more documentation todos
I have decided not to include a manual page for
cowboy_stream_h at this point because it clashes
with the cowboy_stream manual page. This decision
will be revisited in the future.
2017-09-04 14:33:44 +02:00
Loïc Hoguin
3099fc1d9f
Remove cowboy_sub_protocol from the documentation
This will be reintroduced in a future release once the
interface stabilizes. For the time being it will be an
internal module only.
2017-07-20 18:28:06 +02:00
Loïc Hoguin
c2beff7126
Initial cowboy_stream manual 2017-04-10 16:37:01 +02:00
Loïc Hoguin
a45813c60f
Allow passing options to sub protocols
Before this commit we had an issue where configuring a
Websocket connection was simply not possible without
doing magic, adding callbacks or extra return values.
The init/2 function only allowed setting hibernate
and timeout options.

After this commit, when switching to a different
type of handler you can either return

  {module, Req, State}

or

  {module, Req, State, Opts}

where Opts is any value (as far as the sub protocol
interface is concerned) and is ultimately checked
by the custom handlers.

A large protocol like Websocket would accept only
a map there, with many different options, while a
small interface like loop handlers would allow
passing hibernate and nothing else.

For Websocket, hibernate must be set from the
websocket_init/1 callback, because init/2 executes
in a separate process.

Sub protocols now have two callbacks: one with the
Opts value, one without.

The loop handler code was largely reworked and
simplified. It does not need to manage a timeout
or read from the socket anymore, it's the job of
the protocol code. A lot of unnecessary stuff was
therefore removed.

Websocket compression must now be enabled from
the handler options instead of per listener. This
means that a project can have two separate Websocket
handlers with different options. Compression is
still disabled by default, and the idle_timeout
value was changed from inifnity to 60000 (60 seconds),
as that's safer and is also a good value for mobile
devices.
2017-02-18 18:26:20 +01:00
Loïc Hoguin
afc7d08813
Leave a few manual pages for post 2.0.0-pre.4
In particular the cowboy_sub_protocol is subject to change soon.
Also the cowboy_stream behavior is going to be left hidden in
this release and enabled when it becomes easier to chain them.
2016-12-23 18:56:05 +01:00
Loïc Hoguin
5477d613f9 Tweak the one-liner description of the project 2016-09-29 22:46:26 +02:00
Loïc Hoguin
e80291fbdc Tweak the cowboy(7) manual 2016-09-25 23:27:34 +02:00
Loïc Hoguin
fa58155f72 Update the cowboy(7) manual
It now links to all modules found in the manual and can therefore
easily act as an index for the application.
2016-09-25 23:14:19 +02:00
Loïc Hoguin
4023e7f4e4 Convert the documentation to Asciidoc
A few small revisions were made, and Erlang.mk has been updated.
2016-01-14 13:37:20 +01:00
Renamed from doc/src/manual/cowboy_app.ezdoc (Browse further)