All Downloads are FREE. Search and download functionalities are using the official Maven repository.

.port_messaging.1.4.3.source-code.MessagingPort.kt Maven / Gradle / Ivy

There is a newer version: 1.4.4
Show newest version
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