class Zipkin::AsyncReporter::Buffer
Public Class Methods
new()
click to toggle source
# File lib/zipkin/async_reporter/buffer.rb, line 6 def initialize @buffer = [] @mutex = Mutex.new end
Public Instance Methods
<<(element)
click to toggle source
# File lib/zipkin/async_reporter/buffer.rb, line 11 def <<(element) @mutex.synchronize do @buffer << element true end end
retrieve()
click to toggle source
# File lib/zipkin/async_reporter/buffer.rb, line 18 def retrieve @mutex.synchronize do elements = @buffer.dup @buffer.clear elements end end