|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.internal.I2CPMessageQueue
public abstract class I2CPMessageQueue
Contains the methods to talk to a router or client via I2CP, when both are in the same JVM. This interface contains methods to access two queues, one for transmission and one for receiving. The methods are identical to those in java.util.concurrent.BlockingQueue. Reading may be done in a thread using the QueuedI2CPMessageReader class. Non-blocking writing may be done directly with offer().
Constructor Summary | |
---|---|
I2CPMessageQueue()
|
Method Summary | |
---|---|
void |
close()
== offer(new PoisonI2CPMessage()); |
abstract boolean |
offer(I2CPMessage msg)
Send a message, nonblocking. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public I2CPMessageQueue()
Method Detail |
---|
public abstract boolean offer(I2CPMessage msg)
public abstract I2CPMessage poll()
public abstract void put(I2CPMessage msg) throws InterruptedException
InterruptedException
public abstract I2CPMessage take() throws InterruptedException
InterruptedException
public void close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |