@register('<STR_LIT>')<EOL>def reload(daemon, load_type=None, spread=None):
<EOL>if load_type == '<STR_LIT>':<EOL><INDENT>spread = None<EOL><DEDENT>elif load_type == '<STR_LIT>':<EOL><INDENT>try:<EOL><INDENT>spread = float(spread)<EOL><DEDENT>except (TypeError, ValueError):<EOL><INDENT>load_type = None<EOL><DEDENT><DEDENT>else:<EOL><INDENT>load_type = None<EOL><DEDENT>if load_type is None:<EOL><INDENT>try:<EOL><INDENT>spread = float(daemon.config['<STR_LIT>']['<STR_LIT>'])<EOL><DEDENT>except (TypeError, ValueError, KeyError):<EOL><INDENT>spread = None<EOL><DEDENT><DEDENT>if spread:<EOL><INDENT>eventlet.spawn_after(random.random() * spread, daemon.reload)<EOL><DEDENT>else:<EOL><INDENT>eventlet.spawn_n(daemon.reload)<EOL><DEDENT>
Process the 'reload' control message.

:param daemon: The control daemon; used to get at the
               configuration and call the actual reload.
:param load_type: Optional type of reload.  If given as
                  'immediate', reload is triggered
                  immediately.  If given as 'spread', reload
                  is triggered after a random period of time
                  in the interval (0.0, spread).  Otherwise,
                  reload will be as configured.
:param spread: Optional argument for 'spread' load_type.  Must
               be a float giving the maximum length of the
               interval, in seconds, over which the reload
               should be scheduled.  If not provided, falls
               back to configuration.

If a recognized load_type is not given, or is given as
'spread' but the spread parameter is not a valid float, the
configuration will be checked for the 'redis.reload_spread'
value.  If that is a valid value, the reload will be randomly
scheduled for some time within the interval (0.0,
redis.reload_spread).