.port_messaging.1.4.3.source-code.MessagingPort.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of port_messaging Show documentation
Show all versions of port_messaging Show documentation
The atoms of your platform
package com.hexagonkt.messaging
import kotlin.reflect.KClass
// TODO 'unsubscribe' and 'call' (publish and wait response)
interface MessagingPort {
fun consume(type: KClass, address: String, consumer: (T) -> Unit)
fun publish(message: Message, address: String)
fun consume(type: KClass, consumer: (T) -> Unit) {
consume(type, type.java.name, consumer)
}
fun publish(message: Message) {
publish(message, message.javaClass.name)
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy