public abstract class I2CPMessageQueue extends Object implements Closeable
| Constructor and Description |
|---|
I2CPMessageQueue() |
| Modifier and Type | Method and Description |
|---|---|
void | close()== offer(new PoisonI2CPMessage()); |
abstract boolean | offer(I2CPMessage msg)Send a message, nonblocking. |
abstract boolean | offer(I2CPMessage msg,
long timeout)Send a message, blocking. |
abstract I2CPMessage | poll()Receive a message, nonblocking. |
abstract void | put(I2CPMessage msg)Send a message, blocking until space is available. |
abstract I2CPMessage | take()Receive a message, blocking until one is available. |
public void close()
close in interface Closeableclose in interface AutoCloseablepublic abstract boolean offer(I2CPMessage msg)
public abstract boolean offer(I2CPMessage msg, long timeout) throws InterruptedException
timeout - how long to wait for space (ms)InterruptedExceptionpublic abstract I2CPMessage poll()
public abstract void put(I2CPMessage msg) throws InterruptedException
InterruptedExceptionpublic abstract I2CPMessage take() throws InterruptedException
InterruptedException