FeatureMessageProcessor

expect abstract class FeatureMessageProcessor : Closeable(source)

Represents a provider responsible for handling outbound feature messages or events.

Feature processors are used to encapsulate feature-related logic and provide a common interface for handling feature messages and events, such as

  • Node started

  • Node finished

  • Strategy started, etc.

Implementations of this interface are designed to process feature messages, which are encapsulated in the FeatureMessage type and presented as a model for an event to be sent to a target stream. These messages carry information about various events or updates related to features in the system.

Inheritors

actual abstract class FeatureMessageProcessor : <ERROR CLASS> ERROR CLASS: Symbol not found for Closeable(source)

Abstract class responsible for processing feature messages within the system.

The FeatureMessageProcessor provides functionality for filtering and handling incoming feature messages. Classes inheriting from this abstract class are expected to implement the necessary logic for processing messages.

This class provides Java-friendly APIs for initializing and processing messages synchronously, in addition to its coroutine-based methods for use in Kotlin.

Java subclasses should override handleMessage and handleClose instead of the suspend processMessage and close methods to avoid dealing with Kotlin coroutine internals.

actual abstract class FeatureMessageProcessor : Closeable(source)

Abstract class responsible for processing feature messages or events within the system.

The FeatureMessageProcessor serves as a foundational interface for implementing processors that handle various feature-related messages. These messages, represented by the FeatureMessage type, encapsulate relevant information about events or updates in the system.

This class provides mechanisms to filter incoming messages, manage processing states, and ensure proper handling through a defined workflow.

Constructors

Link copied to clipboard
expect constructor()
actual constructor()
actual constructor()

Properties

Link copied to clipboard
expect open val isOpen: StateFlow<Boolean>

A StateFlow representing the current open state of the processor.

actual open val isOpen: StateFlow<Boolean>

A StateFlow representing the current open state of the processor.

actual open val isOpen: StateFlow<Boolean>

A StateFlow representing the current open state of the processor.

Link copied to clipboard

A filter for messages to be sent to message processors.

A filter for messages to be sent to message processors.

A filter for messages to be sent to message processors.

Functions

Link copied to clipboard
expect open suspend override fun close()

Releases resources held by this processor.

actual open suspend override fun close()

Releases resources held by this processor. The default implementation delegates to handleClose.

actual open suspend override fun close()

Releases resources held by this processor.

Link copied to clipboard
open fun handleClose()

Releases resources held by this processor. This is a non-suspend version of close for overriding from Java code.

Link copied to clipboard
expect open suspend fun initialize()

Initializes the feature output stream provider to ensure it is ready for use.

actual open suspend fun initialize()

Initializes the feature output stream provider to ensure it is ready for use.

actual open suspend fun initialize()

Initializes the feature output stream provider to ensure it is ready for use.

Link copied to clipboard
fun javaNonSuspendInitialize(executorService: ExecutorService? = null)

Initializes the feature output stream provider to ensure it is ready for use. This is a blocking version of initialize for use from Java code.

Link copied to clipboard
fun javaNonSuspendOnMessage(message: FeatureMessage, executorService: ExecutorService? = null)

Receives and processes an incoming feature message. This is a blocking version of onMessage for use from Java code.

Link copied to clipboard
expect suspend fun onMessage(message: FeatureMessage)

Receives and processes an incoming feature message.

actual suspend fun onMessage(message: FeatureMessage)

Receives and processes an incoming feature message.

actual suspend fun onMessage(message: FeatureMessage)

Receives and processes an incoming feature message.

Link copied to clipboard
expect fun setMessageFilter(filter: (FeatureMessage) -> Boolean)

Sets the message filter used to determine which feature messages should be processed.

actual fun setMessageFilter(filter: (FeatureMessage) -> Boolean)

Sets the message filter used to determine which feature messages should be processed.

actual fun setMessageFilter(filter: (FeatureMessage) -> Boolean)

Sets the message filter used to determine which feature messages should be processed.