summaryrefslogtreecommitdiff
path: root/INSTALL.in
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2009-07-29 14:10:59 +0100
committerMatthew Sackman <matthew@lshift.net>2009-07-29 14:10:59 +0100
commit2a571d8b582fade0bdc34084cc08cd11c920b881 (patch)
treef92c16dfa3dcd89f4ecad40263ee21ba1b610682 /INSTALL.in
parente14431f715a1edcc9a2b5df1757b4bd574c11196 (diff)
downloadrabbitmq-server-git-2a571d8b582fade0bdc34084cc08cd11c920b881.tar.gz
Implemented. Seems to work well. Changed the design and behaviour of the backoff as discussed with Matthias over IM. Documented in comments, reproduced here:
%% 5) init can return a 4th arg, {backoff, InitialTimeout, %% MinimumTimeout, DesiredHibernatePeriod} (all in %% milliseconds). Then, on all callbacks which can return a timeout %% (including init), timeout can be 'hibernate'. When this is the %% case, the current timeout value will be used (initially, the %% InitialTimeout supplied from init). After this timeout has %% occurred, handle_pre_hibernate/1 will be called. If that returns %% {hibernate, State} then the process will be hibernated. Upon %% awaking, a new current timeout value will be calculated, and then %% handle_post_hibernate/1 will be called. The purpose is that the %% gen_server2 takes care of adjusting the current timeout value such %% that the process will increase the timeout value repeatedly if it %% is unable to sleep for the DesiredHibernatePeriod. If it is able to %% sleep for the DesiredHibernatePeriod it will decrease the current %% timeout down to the MinimumTimeout, so that the process is put to %% sleep sooner (and hopefully for longer). In short, should a process %% using this receive a burst of messages, it should not hibernate %% between those messages, but as the messages become less frequent, %% the process will not only hibernate, it will do so sooner after %% each message. %% %% Normal timeout values (i.e. not 'hibernate') can still be used, and %% if they are used then the handle_info(timeout, State) will be %% called as normal. In this case, returning 'hibernate' from %% handle_info(timeout, State) will not hibernate the process %% immediately, as it would if backoff wasn't being used. Instead %% it'll wait for the current timeout as described above, before %% calling handle_pre_hibernate(State).
Diffstat (limited to 'INSTALL.in')
0 files changed, 0 insertions, 0 deletions