public class QueueDoubleChannel extends QueuePrimitiveChannel<java.lang.Double> implements DoubleChannel
ReceivePort.EOFExceptionRECORDER| Constructor and Description |
|---|
QueueDoubleChannel(BasicSingleConsumerDoubleQueue queue,
Channels.OverflowPolicy policy) |
| Modifier and Type | Method and Description |
|---|---|
protected BasicSingleConsumerDoubleQueue |
queue() |
double |
receiveDouble()
Retrieves a message from the channels, possibly blocking until one becomes available.
|
double |
receiveDouble(long timeout,
java.util.concurrent.TimeUnit unit)
Retrieves a message from the channels, possibly blocking until one becomes available, but no longer than the specified timeout.
|
double |
receiveDouble(Timeout timeout)
Retrieves a message from the channels, possibly blocking until one becomes available, but no longer than the specified timeout.
|
void |
send(double message)
Sends a message to the channel, possibly blocking until there's room available in the channel.
|
boolean |
send(double message,
long timeout,
java.util.concurrent.TimeUnit unit)
Sends a message to the channel, possibly blocking until there's room available in the channel, but never longer than the
specified timeout.
|
boolean |
send(double message,
Timeout timeout)
Sends a message to the channel, possibly blocking until there's room available in the channel, but never longer than the
specified timeout.
|
boolean |
trySend(double message)
Sends a message to the channel if the channel has room available.
|
checkClosed, getStrand, hasMessage, maybeSetCurrentStrandAsOwner, setStrandcapacity, close, close, equals, getCloseException, getOverflowPolicy, getQueueLength, isClosed, isSingleConsumer, isSingleProducer, receive, receive, receive, receiveFromThread, receiveFromThread, register, register, send, send, send, send0, sendNonSuspendable, sendSync, signalAndWait, signalReceivers, sync, toString, tryNow, tryReceive, trySend, unregister, writeReplaceclone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclose, send, send, send, trySendhasMessagereceive, receive, receive, tryReceiveclose, isClosedpublic QueueDoubleChannel(BasicSingleConsumerDoubleQueue queue, Channels.OverflowPolicy policy)
public double receiveDouble()
throws SuspendExecution,
java.lang.InterruptedException,
ReceivePort.EOFException
DoubleReceivePortReceivePort.EOFException.receiveDouble in interface DoubleReceivePortjava.lang.InterruptedExceptionReceivePort.EOFException - if the channel has been closed and no more messages awaitSuspendExecutionpublic double receiveDouble(long timeout,
java.util.concurrent.TimeUnit unit)
throws SuspendExecution,
java.lang.InterruptedException,
java.util.concurrent.TimeoutException,
ReceivePort.EOFException
DoubleReceivePortReceivePort.EOFException.receiveDouble in interface DoubleReceivePorttimeout - the maximum duration to block waiting for a message.unit - the time unit of the timeout.PortAutoCloseable.isClosed()), or if the timeout has expired.java.lang.InterruptedExceptionjava.util.concurrent.TimeoutException - if the timeout has expiredReceivePort.EOFException - if the channel has been closed and no more messages awaitSuspendExecutionpublic double receiveDouble(Timeout timeout) throws SuspendExecution, java.lang.InterruptedException, java.util.concurrent.TimeoutException, ReceivePort.EOFException
DoubleReceivePortReceivePort.EOFException.receiveDouble in interface DoubleReceivePorttimeout - the method will not block for longer than the amount remaining in the TimeoutPortAutoCloseable.isClosed()), or if the timeout has expired.java.lang.InterruptedExceptionjava.util.concurrent.TimeoutException - if the timeout has expiredReceivePort.EOFException - if the channel has been closed and no more messages awaitSuspendExecutionpublic boolean trySend(double message)
DoubleSendPorttrySend in interface DoubleSendPorttrue if the message has been sent; false otherwise.public void send(double message)
throws SuspendExecution,
java.lang.InterruptedException
DoubleSendPortOverflowPolicy, set at construction time.send in interface DoubleSendPortSuspendExecutionjava.lang.InterruptedExceptionpublic boolean send(double message,
long timeout,
java.util.concurrent.TimeUnit unit)
throws SuspendExecution,
java.lang.InterruptedException
DoubleSendPortOverflowPolicy, set at construction time.send in interface DoubleSendPorttimeout - the maximum duration this method is allowed to wait.unit - the timeout's time unittrue if the message has been sent successfully; false if the timeout has expired.SuspendExecutionjava.lang.InterruptedExceptionpublic boolean send(double message,
Timeout timeout)
throws SuspendExecution,
java.lang.InterruptedException
DoubleSendPortOverflowPolicy, set at construction time.send in interface DoubleSendPorttimeout - the method will not block for longer than the amount remaining in the Timeouttrue if the message has been sent successfully; false if the timeout has expired.SuspendExecutionjava.lang.InterruptedExceptionprotected BasicSingleConsumerDoubleQueue queue()
queue in class QueuePrimitiveChannel<java.lang.Double>