Examples of offer()


Examples of com.dianping.cat.message.io.DefaultMessageQueue.offer()

    long now = System.currentTimeMillis();
    int num = 10000;
    DefaultMessageQueue queue = new DefaultMessageQueue(num);

    for (int i = 0; i < num; i++) {
      queue.offer(newMessageTree(i, now + i * 10L));
    }

    MessageAnalyzer analyzer = manager.getAnalyzer("dump", now);

    analyzer.analyze(queue);
View Full Code Here

Examples of com.dianping.cat.message.spi.MessageQueue.offer()

    Assert.assertEquals(true, analyzer.isActive());
    Assert.assertEquals(true, analyzer.isTimeout());

    int count = 2000;
    for (int i = 0; i < count; i++) {
      queue.offer(new DefaultMessageTree());
    }

    analyzer.analyze(queue);

    Assert.assertEquals(Math.min(queueSize, count), analyzer.m_count);
View Full Code Here

Examples of com.hazelcast.core.IQueue.offer()

    private List<Runnable> loadQOperations() {
        List<Runnable> operations = new ArrayList<Runnable>();
        addOperation(operations, new Runnable() {
            public void run() {
                IQueue q = hazelcast.getQueue("myQ");
                q.offer(new byte[100]);
            }
        }, 10);
        addOperation(operations, new Runnable() {
            public void run() {
                IQueue q = hazelcast.getQueue("myQ");
View Full Code Here

Examples of com.hazelcast.core.IQueue.offer()

        }, 10);
        addOperation(operations, new Runnable() {
            public void run() {
                IQueue q = hazelcast.getQueue("myQ");
                try {
                    q.offer(new byte[100], 10, TimeUnit.MILLISECONDS);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        }, 10);
View Full Code Here

Examples of com.hazelcast.core.TransactionalQueue.offer()

    public Object innerCall() throws Exception {
        final ClientEndpoint endpoint = getEndpoint();
        final TransactionContext context = endpoint.getTransactionContext(txnId);
        final TransactionalQueue queue = context.getQueue(name);
        return queue.offer(data, timeout, TimeUnit.MILLISECONDS);
    }

    public String getServiceName() {
        return QueueService.SERVICE_NAME;
    }
View Full Code Here

Examples of com.hazelcast.queue.impl.QueueContainer.offer()

    @Override
    public void run() {
        QueueContainer container = getOrCreateContainer();
        if (container.hasEnoughCapacity()) {
            itemId = container.offer(data);
            response = true;
        } else {
            response = false;
        }
    }
View Full Code Here

Examples of com.llfix.util.DiskQueue.offer()

public class TestDiskQueue {

  @Test
  public void basicTest() throws Exception{
    DiskQueue d = DiskQueue.getInstance("test.fix");
    d.offer("hello world");
    d.offer("hello world");
    d.close();
   
    DiskQueue e = DiskQueue.getInstance("test.fix");
   
View Full Code Here

Examples of com.netflix.suro.queue.FileQueue4Sink.offer()

        assertEquals(queue.size(), 0);
        assertEquals(queue.isEmpty(), true);
        assertEquals(queue.drain(100, new LinkedList<Message>()), 0);

        for (int i = 0; i < 100; ++i) {
            queue.offer(new Message("routingkey" + i, ("value" + i).getBytes()));
        }

        assertEquals(queue.size(), 100);
        assertEquals(queue.isEmpty(), false);
View Full Code Here

Examples of com.netflix.suro.queue.MemoryQueue4Sink.offer()

        assertEquals(queue.size(), 0);
        assertEquals(queue.isEmpty(), true);
        assertEquals(queue.drain(100, new LinkedList<Message>()), 0);

        for (int i = 0; i < 100; ++i) {
            queue.offer(new Message("routingkey" + i, ("value" + i).getBytes()));
        }

        assertEquals(queue.size(), 100);
        assertEquals(queue.isEmpty(), false);
View Full Code Here

Examples of edu.emory.mathcs.backport.java.util.concurrent.BlockingQueue.offer()

      }
      try {
         if (this.asyncSendQueueBlockOnOverflow)
            queue.put(emailData);
         else {
            boolean added = queue.offer(emailData);
            if (!added) {
               throw new XmlBlasterException(glob,
                     ErrorCode.RESOURCE_CONFIGURATION_CONNECT, "SmtpClient",
                     "Can't send email, queueu overflow of asyncSendQueueSizeMax="+this.asyncSendQueueSizeMax+", there may be a problem with your Smtp server, the mail is lost: " + emailData.toXml(true));
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.