Package com.caucho.hemp.packet

Examples of com.caucho.hemp.packet.Packet


  protected Packet dequeue(WaitQueue.Item item, long timeout)
  {
    item.startPark();

    try {
      Packet packet = _queue.dequeue();

      if (packet == null) {
        if (timeout <= 0)
          return null;

        item.park(timeout);

        packet = _queue.dequeue();
      }

      if (packet != null)
        packet.unparkDequeue();

      return packet;
    } finally {
      item.endPark();
    }
View Full Code Here


  private void consumeQueue(WaitQueue.Item item)
  {
    while (! isClosed()) {
      try {
        Packet packet;

        // _dequeueCount.incrementAndGet();
        packet = _queue.dequeue();
        // _dequeueCount.decrementAndGet();

        if (packet != null) {
          // reset last exit with a new packet
          _lastExitTime = Alarm.getCurrentTime();

          if (log.isLoggable(Level.FINEST))
            log.finest(this + " dequeue " + packet);

          packet.unparkDequeue();

          dispatch(packet, item);
        }
        else if (! waitForQueue(item)) {
          return;
View Full Code Here

TOP

Related Classes of com.caucho.hemp.packet.Packet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.