def queued_spans
      return [] if @queue.empty?

      spans = []
      until @queue.empty? do
        # Non-blocking pop; ignore exception
        trace = @queue.pop(true) rescue nil
        trace.spans.each do |s|
          spans << s.raw
        end
      end
      spans
    end
def queued_spans
      return [] if @queue.empty?

      spans = []
      until @queue.empty? do
        # Non-blocking pop; ignore exception
        trace = @queue.pop(true) rescue nil
        trace.spans.each do |s|
          spans << s.raw
        end
      end
      spans
    end
Retrieves all of the traces in @queue and returns
 the sum of their raw spans.
 This is used by Processor::send and in the test suite.
 Note that traces retrieved with this method are removed
 entirely from the queue.

 @return [Array] An array of [Span] or empty