Created
March 21, 2013 22:12
-
-
Save jmettraux/5217277 to your computer and use it in GitHub Desktop.
This file contains 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
# The context will call this method for each msg sucessfully processed | |
# by the worker. | |
# | |
def on_msg(msg) | |
puts(fancy_print(msg, @noisy)) if @noisy | |
return if msg['action'] == 'noop' | |
@on_msg_mutex.synchronize do | |
@seen << msg | |
@log << msg | |
while @log.size > @log_max; @log.shift; end | |
while @seen.size > @log_max; @seen.shift; end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment