Package co.paralleluniverse.strands.queues

Examples of co.paralleluniverse.strands.queues.QueueCapacityExceededException


    void onQueueFull(int iter, boolean timed, long nanos) throws SuspendExecution, InterruptedException, TimeoutException {
        switch (overflowPolicy) {
            case DROP:
                return;
            case THROW:
                throw new QueueCapacityExceededException();
            case BLOCK:
                if (timed)
                    sendersSync.await(iter, nanos, TimeUnit.NANOSECONDS);
                else
                    sendersSync.await(iter);
                break;
            case BACKOFF:
                if (iter > MAX_SEND_RETRIES)
                    throw new QueueCapacityExceededException();
                if (iter > 5)
                    Strand.sleep((iter - 5) * 5);
                else if (iter > 4)
                    Strand.yield();
        }
View Full Code Here


    void onQueueFull(int iter, boolean timed, long nanos) throws SuspendExecution, InterruptedException, TimeoutException {
        switch (overflowPolicy) {
            case DROP:
                return;
            case THROW:
                throw new QueueCapacityExceededException();
            case BLOCK:
                if (timed)
                    sendersSync.await(iter, nanos, TimeUnit.NANOSECONDS);
                else
                    sendersSync.await(iter);
                break;
            case BACKOFF:
                if (iter > MAX_SEND_RETRIES)
                    throw new QueueCapacityExceededException();
                if (iter > 5)
                    Strand.sleep((iter - 5) * 5);
                else if (iter > 4)
                    Strand.yield();
        }
View Full Code Here

            record("sendNonSuspendable", "%s channel is closed for send. Dropping message %s", this, message);
            return;
        }
        record("sendNonSuspendable", "%s enqueing message %s", this, message);
        if (!queue.enq(message))
            throw new QueueCapacityExceededException();
        signalReceivers();
    }
View Full Code Here

    }

    @Override
    public void send(Message message) {
        if (!queue.enq(message))
            throw new QueueCapacityExceededException();
        signal();
    }
View Full Code Here

        signal();
    }

    public void sendSync(Message message) {
        if (!queue.enq(message))
            throw new QueueCapacityExceededException();
        signalAndTryToExecNow();
    }
View Full Code Here

TOP

Related Classes of co.paralleluniverse.strands.queues.QueueCapacityExceededException

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.