- All Superinterfaces:
CloseableChannel
- All Known Implementing Classes:
Channel
A channel sink, which can be used to send values to the channel. See
Channel for more details.-
Method Summary
Modifier and TypeMethodDescriptionvoidSend a value to the channel.sendClause(T value) Create a clause which can be used inSelect.select(SelectClause[]).<U> SelectClause<U> sendClause(T value, Supplier<U> callback) Create a clause which can be used inSelect.select(SelectClause[]).sendOrClosed(T value) Send a value to the channel.Methods inherited from interface com.softwaremill.jox.CloseableChannel
closedForReceive, closedForSend, done, doneOrClosed, error, errorOrClosed, isClosedForReceive, isClosedForSend
-
Method Details
-
send
Send a value to the channel.- Parameters:
value- The value to send. Notnull.- Throws:
ChannelClosedException- When the channel is closed.InterruptedException
-
sendOrClosed
Send a value to the channel. Doesn't throw exceptions when the channel is closed, but returns a value.- Parameters:
value- The value to send. Notnull.- Returns:
- Either
null, orChannelClosed, when the channel is closed. - Throws:
InterruptedException
-
sendClause
Create a clause which can be used inSelect.select(SelectClause[]). The clause will send the given value to the current channel, and returnnullas the clause's result. -
sendClause
Create a clause which can be used inSelect.select(SelectClause[]). The clause will send the given value to the current channel, and return the value of the provided callback as the clause's result.
-