public class QueueFloatChannel extends QueuePrimitiveChannel<java.lang.Float> implements FloatChannel
ReceivePort.EOFExceptionRECORDER| Constructor and Description |
|---|
QueueFloatChannel(BasicSingleConsumerFloatQueue queue,
Channels.OverflowPolicy policy) |
| Modifier and Type | Method and Description |
|---|---|
protected BasicSingleConsumerFloatQueue |
queue() |
float |
receiveFloat()
Retrieves a message from the channels, possibly blocking until one becomes available.
|
float |
receiveFloat(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.
|
float |
receiveFloat(Timeout timeout)
Retrieves a message from the channels, possibly blocking until one becomes available, but no longer than the specified timeout.
|
void |
send(float message)
Sends a message to the channel, possibly blocking until there's room available in the channel.
|
boolean |
send(float 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(float 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(float 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 QueueFloatChannel(BasicSingleConsumerFloatQueue queue, Channels.OverflowPolicy policy)
public float receiveFloat()
throws SuspendExecution,
java.lang.InterruptedException,
ReceivePort.EOFException
FloatReceivePortReceivePort.EOFException.receiveFloat in interface FloatReceivePortjava.lang.InterruptedExceptionReceivePort.EOFException - if the channel has been closed and no more messages awaitSuspendExecutionpublic float receiveFloat(long timeout,
java.util.concurrent.TimeUnit unit)
throws SuspendExecution,
java.lang.InterruptedException,
java.util.concurrent.TimeoutException,
ReceivePort.EOFException
FloatReceivePortReceivePort.EOFException.receiveFloat in interface FloatReceivePorttimeout - 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 float receiveFloat(Timeout timeout) throws SuspendExecution, java.lang.InterruptedException, java.util.concurrent.TimeoutException, ReceivePort.EOFException
FloatReceivePortReceivePort.EOFException.receiveFloat in interface FloatReceivePorttimeout - 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(float message)
FloatSendPorttrySend in interface FloatSendPorttrue if the message has been sent; false otherwise.public void send(float message)
throws SuspendExecution,
java.lang.InterruptedException
FloatSendPortOverflowPolicy, set at construction time.send in interface FloatSendPortSuspendExecutionjava.lang.InterruptedExceptionpublic boolean send(float message,
long timeout,
java.util.concurrent.TimeUnit unit)
throws SuspendExecution,
java.lang.InterruptedException
FloatSendPortOverflowPolicy, set at construction time.send in interface FloatSendPorttimeout - 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(float message,
Timeout timeout)
throws SuspendExecution,
java.lang.InterruptedException
FloatSendPortOverflowPolicy, set at construction time.send in interface FloatSendPorttimeout - 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 BasicSingleConsumerFloatQueue queue()
queue in class QueuePrimitiveChannel<java.lang.Float>