Skip to content

Commit

Permalink
#15, #24 - Set 'hibernate' atom to hibernate always
Browse files Browse the repository at this point in the history
  • Loading branch information
majek committed Apr 12, 2012
1 parent 39f2c87 commit e4e11ea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,11 @@ simple. It has just a couple of methods:
after the client was last connected (in ms).
* `{response_limit, integer()}` - the maximum size of a single
http streaming response (in bytes).
* `{hib_timeout, integer()}` - hibernate websocket process after
hib_timeout milliseconds of inactivity (5000 by default) to
reduce memory footprint. (implementation is incomplete, see #15)
* `{hib_timeout, integer() | hibernate}` - hibernate websocket
process after hib_timeout milliseconds of inactivity (5000 by
default) to reduce memory footprint. Set to 'hibernate' atom to
hibernate always (may be inefficient). (implementation is
incomplete, see #15)
* `{logger, fun/3}` - a function called on every request, used
to print request to the logs (or on the screen by default).

Expand Down
3 changes: 3 additions & 0 deletions src/sockjs_cowboy_handler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ websocket_terminate(_Reason, _Req, {RawWebsocket, SessionPid, _HT}) ->

%% --------------------------------------------------------------------------

mh({ok, Req, {RawWebsocket, SessionPid, {TRef, hibernate}}}) ->
{ok, Req, {RawWebsocket, SessionPid, {TRef, hibernate}}, hibernate};

mh({ok, Req, {RawWebsocket, SessionPid, {TRef, HibTimeout}}}) ->
case TRef of
undefined -> ok;
Expand Down

0 comments on commit e4e11ea

Please sign in to comment.