Package-level declarations

Types

Link copied to clipboard

Interface representing a coroutine-based message broker that supports sending, receiving, and responding to messages.

Link copied to clipboard

The interface for handling Pub/Sub messages of type T.

Link copied to clipboard
interface ResponderCoroutines<T : Any, Y : Any> : Function1<T, Y?>

The interface for handling Pub/Sub messages of type T and providing a response of type Y.

Functions

Link copied to clipboard
inline suspend fun <T : Any> BrokerCoroutines.listen(noinline handler: suspend (T) -> Unit): AutoCloseable

Registers a handler to listen for messages of a specific type.

Link copied to clipboard
inline suspend fun <R : Any> BrokerCoroutines.request(message: Any, vararg targets: Target): R

Sends a request and awaits a response using the default timeout.

inline suspend fun <R : Any> BrokerCoroutines.request(message: Any, timeout: Duration, vararg targets: Target): R

Sends a request and awaits a response within a specified timeout.

Link copied to clipboard
inline suspend fun <T : Any, R : Any> BrokerCoroutines.respond(noinline handler: suspend (T) -> R?): AutoCloseable

Registers a function to respond to incoming messages of a specific type.

Link copied to clipboard
fun Broker.withCoroutines(scope: CoroutineScope): BrokerCoroutines

Extension for the Broker interface to integrate with coroutines.