Interface Channel.Binding<T>
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the binding.voidDelivers the message, blocking if necessary.booleantryPublish(T message) Attempts to deliver the message immediately.
-
Method Details
-
tryPublish
Attempts to deliver the message immediately. Must not block. If the message was delivered successfully, then returns true. Otherwise, returns false.- Parameters:
message- the message to publish- Returns:
- true if the message was published, false otherwise
-
publish
Delivers the message, blocking if necessary. This method must not return until the message is delivered.- Parameters:
message- the message to publish- Throws:
InterruptedException- if the thread is interrupted while waiting
-
close
void close()Closes the binding. No more messages will be delivered after this method is called. Any threads currently blocking while trying to publish a message will be interrupted. When this method returns, all blocking threads will have been interrupted, but not joined.
-