public interface MailboxSender
Mailbox
interface. This is used to enqueue letters. Multiple producers threads
can put to the same mailbox.Modifier and Type | Method and Description |
---|---|
void |
putMail(Runnable letter)
Enqueues the given letter to the mailbox and blocks until there is capacity for a successful put.
|
boolean |
tryPutMail(Runnable letter)
Enqueues the given letter to the mailbox, if capacity is available.
|
void |
waitUntilHasCapacity()
This method blocks until the mailbox has again capacity to enqueue new letters.
|
boolean tryPutMail(@Nonnull Runnable letter)
true
and false
if the mailbox was already full.letter
- the letter to enqueue.true
iff successful.void putMail(@Nonnull Runnable letter) throws InterruptedException
letter
- the letter to enqueue.InterruptedException
- on interruption.void waitUntilHasCapacity() throws InterruptedException
InterruptedException
- on interruption.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.