Messaging interface now exposes the nodes own address.

This commit is contained in:
Mike Hearn 2016-01-07 14:56:16 +01:00
parent 5f8dec4ff9
commit 9e22cda15c
2 changed files with 5 additions and 0 deletions

View File

@ -130,6 +130,8 @@ public class InMemoryNetwork {
@GuardedBy("this")
protected val pendingRedelivery = LinkedList<Message>()
override val myAddress: SingleMessageRecipient = handle
protected val backgroundThread = if (manuallyPumped) null else thread(isDaemon = true, name = "In-memory message dispatcher ") {
while (!currentThread.isInterrupted) {
try {

View File

@ -65,6 +65,9 @@ interface MessagingService {
* Returns an initialised [Message] with the current time, etc, already filled in.
*/
fun createMessage(topic: String, data: ByteArray): Message
/** Returns an address that refers to this node */
val myAddress: SingleMessageRecipient
}
/**