def consume
      (queue.size).times do
        mutex.synchronize {
          block.call(queue.deq)
          @lock = true
        }
      end
    end
def consume
      (queue.size).times do
        mutex.synchronize {
          block.call(queue.deq)
          @lock = true
        }
      end
    end
Consumes data from a queue.
 NOTE: If I was to use a while loop
 here, I'd have to find a way of stoping
 the loop. A common way would be pushing
 nil to queue and then it would exit.
 However I'd have to be passing nil ATFT.
 If I didn't pass nil it would raise:
   Failure/Error:
   (anonymous error class);
   No live threads left. Deadlock?
 As there's nothing in queue.

 In Ruby you have a lot of different ways
 to make the same thing.

 This implentation simply asks queue what it's
 size is and then loops through it (i.e times)
 and then I call queue.deq which stands for
 deqeuing.