Code example for BlockingQueue

Methods: put

0
    entry.setTimeStamp(rowId); //Hack: Using TimeStamp field for rowId
 
    try 
    { 
      _bufferPutLatency.resume();
      _buffer.put(entry);
    } finally { 
      _bufferPutLatency.suspend();
    } 
      } 
 
  public boolean readNextEvent(EventProcessor processor)
  { 
    EventBufferEntry entry = null;
    try 
    { 
      _bufferTakeLatency.resume();
      entry = _buffer.take();
    } catch (InterruptedException ie) {
      LOG.error("Got interrupted while waiting for next event !!", ie);
      processor.process(_eofEntry,_scn);