Bot::Backbone::SendPolicy::MinimumInterval - Prevent any message from being delivered too soon
version 0.140590
send_policy no_flooding => ( MinimumInterval => { interval => 1.5, discard => 1, queue_length => 5, }, );
This send policy will prevent any message from being sent more frequently than the permitted "interval". Messages sent more frequently than this will either be delayed to match the interval or discarded.
This is the fractional number of seconds that must pass between each message sent. This attribute is required. The number must be positive (obviously).
This is the number of items that will be queued up before additional items will be discarded.
For example, if "interval" were set to 1 second and queue_length to 10 and a burst of 100 items happened within 1 second, only the first 10 would be sent, 1 per second. The other 90 items would be discarded. There's a slight fudge factor here due to times, so you might see a few more actually sent depending on how much delay happens in handling events.
queue_length
If "discard" is set to false, it is recommended that you set this value to something reasonable.
If set to true, any message sent more frequently than the "interval" will be immediately discarded. This is false by default.
This will be set each time the policy encounters a message. If "discard" is false, this value may move into the future to signify the time at which the last queued message will be sent.
Applies the configured policy to the given message.
Andrew Sterling Hanenkamp <hanenkamp@cpan.org>
This software is copyright (c) 2014 by Qubling Software LLC.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Bot::Backbone, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bot::Backbone
CPAN shell
perl -MCPAN -e shell install Bot::Backbone
For more information on module installation, please visit the detailed CPAN module installation guide.