Last active
October 3, 2017 00:10
-
-
Save lukebakken/0df4191d3883e8f64441a0147440fb84 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
require 'bunny' | |
require 'glutton_ratelimit' | |
require 'pp' | |
conn = Bunny.new | |
conn.start | |
ch = conn.create_channel | |
q = ch.queue('gh-1382') | |
puts "Consuming..." | |
# maximum of five executions every five seconds | |
rl = GluttonRatelimit::AveragedThrottle.new 8, 2 | |
rl.times(16384) do | |
delivery_info, properties, payload = q.pop | |
pp properties | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
require 'bunny' | |
require 'sysrandom' | |
require 'glutton_ratelimit' | |
b = Bunny.new.start | |
ch = b.create_channel | |
q = ch.queue('gh-1382') | |
puts q.name | |
msg = Sysrandom.base64(1024 * 1024 * 4) | |
# maximum of five executions every five seconds | |
rl = GluttonRatelimit::AveragedThrottle.new 5, 1 | |
rl.times(16384) do | |
q.publish msg | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% vim:ft=erlang: | |
[ | |
{rabbit, [ | |
{loopback_users, []}, | |
{vm_memory_high_watermark, 0.05} | |
]} | |
]. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment